Updated output method
Browse files
app.py
CHANGED
|
@@ -51,7 +51,7 @@ app = Server()
|
|
| 51 |
|
| 52 |
# Define Method 1: Triggers when client calls /gradio_api/call/update_data
|
| 53 |
@app.api(name="call_private_api")
|
| 54 |
-
def call_private_api(user_input: str):
|
| 55 |
# Pass the token in the Authorization header
|
| 56 |
headers = {
|
| 57 |
"Authorization": f"Bearer {HF_TOKEN}",
|
|
@@ -82,7 +82,7 @@ def call_private_api(user_input: str):
|
|
| 82 |
|
| 83 |
# Define Method 2: Triggers when client calls /gradio_api/call/process_action
|
| 84 |
@app.api(name="user_feedback")
|
| 85 |
-
def process_user_feedback(user_input: str):
|
| 86 |
# Logic for different client actions
|
| 87 |
return f"user feedback received '{user_input}' processed on server."
|
| 88 |
|
|
|
|
| 51 |
|
| 52 |
# Define Method 1: Triggers when client calls /gradio_api/call/update_data
|
| 53 |
@app.api(name="call_private_api")
|
| 54 |
+
def call_private_api(user_input: str) -> dict:
|
| 55 |
# Pass the token in the Authorization header
|
| 56 |
headers = {
|
| 57 |
"Authorization": f"Bearer {HF_TOKEN}",
|
|
|
|
| 82 |
|
| 83 |
# Define Method 2: Triggers when client calls /gradio_api/call/process_action
|
| 84 |
@app.api(name="user_feedback")
|
| 85 |
+
def process_user_feedback(user_input: str) -> dict:
|
| 86 |
# Logic for different client actions
|
| 87 |
return f"user feedback received '{user_input}' processed on server."
|
| 88 |
|