Update app_template.py
Browse files- app_template.py +3 -3
app_template.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import os
|
| 3 |
import requests
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 8 |
HEADERS = {"Authorization": f"Bearer {HF_TOKEN}"}
|
|
@@ -21,9 +21,9 @@ def build_input_prompt(message, chatbot, system_prompt):
|
|
| 21 |
|
| 22 |
def post_request_beta(payload):
|
| 23 |
"""
|
| 24 |
-
Sends a POST request to the predefined
|
| 25 |
"""
|
| 26 |
-
response = requests.post(
|
| 27 |
response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
|
| 28 |
return response.json()
|
| 29 |
|
|
|
|
| 2 |
import os
|
| 3 |
import requests
|
| 4 |
|
| 5 |
+
tulu = "https://tonic1-tulu.hf.space/--replicas/9sffh/"
|
| 6 |
|
| 7 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 8 |
HEADERS = {"Authorization": f"Bearer {HF_TOKEN}"}
|
|
|
|
| 21 |
|
| 22 |
def post_request_beta(payload):
|
| 23 |
"""
|
| 24 |
+
Sends a POST request to the predefined Tulu URL and returns the JSON response.
|
| 25 |
"""
|
| 26 |
+
response = requests.post(tulu, headers=HEADERS, json=payload)
|
| 27 |
response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
|
| 28 |
return response.json()
|
| 29 |
|