Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,29 +38,30 @@ sample_ge = ["expect_column_values_to_be_in_set(column='property_type', value_se
|
|
| 38 |
"expect_column_values_to_be_unique(column='policy_number'),expect_column_values_to_match_regex(column='policy_number', regex=r'^INS-\d{8}$'),expect_column_values_to_not_be_null(column='policy_number')",
|
| 39 |
"expect_column_values_to_be_json_parseable(column='metadata'),expect_column_values_to_not_be_null(column='metadata') ",
|
| 40 |
"expect_column_values_to_be_of_type(column='score', type_='int'),expect_column_values_to_be_between(column='score', min_value=0, max_value=None)"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
<div style="background-color: #f9f9f9; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); margin-top: 20px;">
|
| 53 |
-
<h2 style="color: #E94E77;">Note on Temperature and min_p Settings</h2>
|
| 54 |
-
<p style="font-size: 16px; color: #333;"> <strong>Important:</strong> When configuring the model settings, it's important to note that setting the <strong style="color: #4A90E2;">temperature</strong> and <strong style="color: #4A90E2;">min_p</strong> to lower values typically results in better Great Expectations (GE) rule generation. Here's why:</p>
|
| 55 |
-
|
| 56 |
-
<ul style="padding-left: 20px;">
|
| 57 |
-
<li style="font-size: 15px; color: #333;"><strong style="color: #4A90E2;">Low Temperature:</strong> A lower temperature (e.g., 0.1) makes the model more deterministic, leading to more focused and coherent output that aligns better with structured data validation rules like those used in GE.</li>
|
| 58 |
-
<li style="font-size: 15px; color: #333;"><strong style="color: #4A90E2;">Low min_p:</strong> Similarly, setting min_p to a lower value (e.g., 0.1) ensures that only highly probable words are selected, reducing randomness and improving the clarity and relevance of the generated rules.</li>
|
| 59 |
-
</ul>
|
| 60 |
-
|
| 61 |
-
<p style="font-size: 16px; color: #333;">Thus, to get more precise and actionable Great Expectations rules, it’s recommended to keep both <strong style="color: #4A90E2;">temperature</strong> and <strong style="color: #4A90E2;">min_p</strong> set to low values.</p>
|
| 62 |
-
</div>
|
| 63 |
-
"""
|
| 64 |
|
| 65 |
Examples = {"Prompts": sample_prompts, "Great Expectations":sample_ge}
|
| 66 |
|
|
@@ -128,7 +129,7 @@ interface = gr.Interface(
|
|
| 128 |
live=False,
|
| 129 |
examples = sample_prompts,
|
| 130 |
cache_examples=True,
|
| 131 |
-
examples_per_page=
|
| 132 |
theme='default',
|
| 133 |
api_name='generate',
|
| 134 |
analytics_enabled=True
|
|
|
|
| 38 |
"expect_column_values_to_be_unique(column='policy_number'),expect_column_values_to_match_regex(column='policy_number', regex=r'^INS-\d{8}$'),expect_column_values_to_not_be_null(column='policy_number')",
|
| 39 |
"expect_column_values_to_be_json_parseable(column='metadata'),expect_column_values_to_not_be_null(column='metadata') ",
|
| 40 |
"expect_column_values_to_be_of_type(column='score', type_='int'),expect_column_values_to_be_between(column='score', min_value=0, max_value=None)"]
|
| 41 |
+
article_content = """
|
| 42 |
+
<div style="background-color: #ffffff; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); margin: 20px; padding: 20px; width: 48%; max-width: 800px;">
|
| 43 |
+
<h2 style="color: #4A90E2; font-size: 24px; margin-bottom: 10px;">Key Features</h2>
|
| 44 |
+
<ul style="list-style-type: none; padding-left: 0;">
|
| 45 |
+
<li style="margin-bottom: 10px; font-size: 16px; color: #555555;"><strong style="color: #4A90E2;">Custom Validation Rules:</strong> Input any data quality validation rule, and the app will generate corresponding Great Expectations expectations.</li>
|
| 46 |
+
<li style="margin-bottom: 10px; font-size: 16px; color: #555555;"><strong style="color: #4A90E2;">Comprehensive Validation Support:</strong> From validating column values, sums, and averages, to ensuring unique values and matching regex patterns, this app supports a wide range of data quality checks.</li>
|
| 47 |
+
<li style="margin-bottom: 10px; font-size: 16px; color: #555555;"><strong style="color: #4A90E2;">User-Friendly Interface:</strong> Simply enter your validation rule prompt, and our app will convert it into an easy-to-implement Great Expectations rule.</li>
|
| 48 |
+
<li style="margin-bottom: 10px; font-size: 16px; color: #555555;"><strong style="color: #4A90E2;">Live Conversion:</strong> Adjust the parameters like temperature and min_p to fine-tune the conversion process, with real-time results.</li>
|
| 49 |
+
</ul>
|
| 50 |
+
</div>
|
| 51 |
|
| 52 |
+
<div style="background-color: #ffffff; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); margin: 20px; padding: 20px; width: 48%; max-width: 800px;">
|
| 53 |
+
<h2 style="color: #E94E77;">Note on Temperature and min_p Settings</h2>
|
| 54 |
+
<p><strong>Important:</strong> When configuring the model settings, it's important to note that setting the <strong style="color: #4A90E2;">temperature</strong> and <strong style="color: #4A90E2;">min_p</strong> to lower values typically results in better Great Expectations (GE) rule generation. Here's why:</p>
|
| 55 |
+
|
| 56 |
+
<ul style="list-style-type: none; padding-left: 0;">
|
| 57 |
+
<li style="margin-bottom: 10px; font-size: 16px; color: #333;"><strong style="color: #4A90E2;">Low Temperature:</strong> A lower temperature (e.g., 0.1) makes the model more deterministic, leading to more focused and coherent output that aligns better with structured data validation rules like those used in GE.</li>
|
| 58 |
+
<li style="margin-bottom: 10px; font-size: 16px; color: #333;"><strong style="color: #4A90E2;">Low min_p:</strong> Similarly, setting min_p to a lower value (e.g., 0.1) ensures that only highly probable words are selected, reducing randomness and improving the clarity and relevance of the generated rules.</li>
|
| 59 |
+
</ul>
|
| 60 |
+
|
| 61 |
+
<p style="font-size: 16px; color: #333;">Thus, to get more precise and actionable Great Expectations rules, it’s recommended to keep both <strong style="color: #4A90E2;">temperature</strong> and <strong style="color: #4A90E2;">min_p</strong> set to low values (0.1).</p>
|
| 62 |
+
</div>
|
| 63 |
+
"""
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
Examples = {"Prompts": sample_prompts, "Great Expectations":sample_ge}
|
| 67 |
|
|
|
|
| 129 |
live=False,
|
| 130 |
examples = sample_prompts,
|
| 131 |
cache_examples=True,
|
| 132 |
+
examples_per_page=6,
|
| 133 |
theme='default',
|
| 134 |
api_name='generate',
|
| 135 |
analytics_enabled=True
|