Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,8 +12,13 @@ def call_api(prompt, history, system_prompt, temperature, max_new_tokens, top_p,
|
|
12 |
"top_p": top_p,
|
13 |
"repetition_penalty": repetition_penalty
|
14 |
}
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
def main_interface():
|
19 |
with gr.Blocks() as demo:
|
|
|
12 |
"top_p": top_p,
|
13 |
"repetition_penalty": repetition_penalty
|
14 |
}
|
15 |
+
try:
|
16 |
+
response = requests.post(url, json=data)
|
17 |
+
response.raise_for_status() # ์ด ๋ถ๋ถ์์ HTTP ์ค๋ฅ ๋ฐ์ ์ ์์ธ๋ฅผ ๋ฐ์์ํต๋๋ค.
|
18 |
+
return response.json()['response']
|
19 |
+
except requests.exceptions.RequestException as e:
|
20 |
+
return f"An error occurred: {str(e)}"
|
21 |
+
|
22 |
|
23 |
def main_interface():
|
24 |
with gr.Blocks() as demo:
|