Spaces:
Sleeping
Sleeping
File size: 490 Bytes
12e34fc 91367ff 12e34fc 91367ff 12e34fc 91367ff b38be7b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
import requests
import json
URL = "198.175.88.52"
myport = "8080"
gaudi_device_url = f"http://{URL}:{myport}/generate"
def greet(name):
return "Hello " + name + "!!"
def text_gen(url, prompt):
resp = requests.post(url, prompt=json.dumps(prompt))
return resp
demo = gr.Interface(
fn=text_gen,
inputs=[gaudi_device_url, "text"],
outputs=["text"], )
#demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch(share=True)
|