Spaces:
Runtime error
Runtime error
Update utility/utils.py
Browse files- utility/utils.py +2 -1
utility/utils.py
CHANGED
|
@@ -186,13 +186,14 @@ def Data_Extractor(data, client=client):
|
|
| 186 |
Output:
|
| 187 |
'''
|
| 188 |
# Call the API for inference
|
| 189 |
-
response = client.text_generation(text, max_new_tokens=
|
| 190 |
|
| 191 |
print("parse in text ---:",response)
|
| 192 |
|
| 193 |
# Convert the response text to JSON
|
| 194 |
try:
|
| 195 |
json_data = json.loads(response)
|
|
|
|
| 196 |
return json_data
|
| 197 |
except json.JSONDecodeError as e:
|
| 198 |
return {"error": f"Error decoding JSON: {e}"}
|
|
|
|
| 186 |
Output:
|
| 187 |
'''
|
| 188 |
# Call the API for inference
|
| 189 |
+
response = client.text_generation(text, max_new_tokens=1000)#, temperature=0.4, top_k=50, top_p=0.9, repetition_penalty=1.2)
|
| 190 |
|
| 191 |
print("parse in text ---:",response)
|
| 192 |
|
| 193 |
# Convert the response text to JSON
|
| 194 |
try:
|
| 195 |
json_data = json.loads(response)
|
| 196 |
+
print("Json_data-------------->",json_data)
|
| 197 |
return json_data
|
| 198 |
except json.JSONDecodeError as e:
|
| 199 |
return {"error": f"Error decoding JSON: {e}"}
|