ae / app.py
sureshnam9's picture
Update app.py
91367ff verified
raw
history blame
490 Bytes
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)