Spaces:
Sleeping
Sleeping
un-index
commited on
Commit
·
bbef3ac
1
Parent(s):
5e06490
app.py
CHANGED
|
@@ -21,6 +21,8 @@ import gradio as gr
|
|
| 21 |
import requests
|
| 22 |
def f(text):
|
| 23 |
try:
|
|
|
|
|
|
|
| 24 |
context = text
|
| 25 |
payload = {
|
| 26 |
"context": context,
|
|
@@ -29,10 +31,10 @@ def f(text):
|
|
| 29 |
"top_p": 0.9,
|
| 30 |
}
|
| 31 |
response = requests.post("http://api.vicgalle.net:5000/generate", params=payload).json()
|
| 32 |
-
|
| 33 |
except Exception as e:
|
| 34 |
return "error: \n"+str(e)
|
| 35 |
-
return response
|
| 36 |
|
| 37 |
|
| 38 |
|
|
|
|
| 21 |
import requests
|
| 22 |
def f(text):
|
| 23 |
try:
|
| 24 |
+
# http://api.vicgalle.net:5000/docs#/default/generate_generate_post
|
| 25 |
+
# https://pythonrepo.com/repo/vicgalle-gpt-j-api-python-natural-language-processing
|
| 26 |
context = text
|
| 27 |
payload = {
|
| 28 |
"context": context,
|
|
|
|
| 31 |
"top_p": 0.9,
|
| 32 |
}
|
| 33 |
response = requests.post("http://api.vicgalle.net:5000/generate", params=payload).json()
|
| 34 |
+
|
| 35 |
except Exception as e:
|
| 36 |
return "error: \n"+str(e)
|
| 37 |
+
return response['text']
|
| 38 |
|
| 39 |
|
| 40 |
|