Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import requests
|
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
import gradio as gr
|
|
|
|
| 5 |
|
| 6 |
token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
| 7 |
API_URL = "https://kp4xdy196cw81uf3.us-east-1.aws.endpoints.huggingface.cloud"
|
|
@@ -14,7 +15,8 @@ headers = {
|
|
| 14 |
def query(payload):
|
| 15 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 16 |
return response.json()
|
| 17 |
-
|
|
|
|
| 18 |
def generate_response(text):
|
| 19 |
input = {
|
| 20 |
"inputs": text,
|
|
|
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
import gradio as gr
|
| 5 |
+
import spaces
|
| 6 |
|
| 7 |
token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
| 8 |
API_URL = "https://kp4xdy196cw81uf3.us-east-1.aws.endpoints.huggingface.cloud"
|
|
|
|
| 15 |
def query(payload):
|
| 16 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 17 |
return response.json()
|
| 18 |
+
|
| 19 |
+
@spaces.GPU
|
| 20 |
def generate_response(text):
|
| 21 |
input = {
|
| 22 |
"inputs": text,
|