Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,12 +37,13 @@ def split_text(text):
|
|
| 37 |
|
| 38 |
def call_api(prompt_text):
|
| 39 |
url = "https://muryshev-mixtral-api-local.hf.space/completion"
|
| 40 |
-
payload = {"prompt": prompt_text, "temperature": 0, "seed": 42, "repeat_penalty": 1, "top_p": 0.95}
|
| 41 |
|
| 42 |
try:
|
| 43 |
response = requests.post(url, json=payload)
|
| 44 |
response.raise_for_status() # Raise an exception for 4xx or 5xx status codes
|
| 45 |
result = response.text # Extract the text result from the JSON response
|
|
|
|
| 46 |
return result
|
| 47 |
except requests.exceptions.RequestException as e:
|
| 48 |
print("Error:", e)
|
|
|
|
| 37 |
|
| 38 |
def call_api(prompt_text):
|
| 39 |
url = "https://muryshev-mixtral-api-local.hf.space/completion"
|
| 40 |
+
payload = {"prompt": prompt_text, "temperature": 0, "seed": 42, "repeat_penalty": 1, "top_p": 0.95, "stream": False}
|
| 41 |
|
| 42 |
try:
|
| 43 |
response = requests.post(url, json=payload)
|
| 44 |
response.raise_for_status() # Raise an exception for 4xx or 5xx status codes
|
| 45 |
result = response.text # Extract the text result from the JSON response
|
| 46 |
+
print(result)
|
| 47 |
return result
|
| 48 |
except requests.exceptions.RequestException as e:
|
| 49 |
print("Error:", e)
|