File size: 378 Bytes
12e34fc
91367ff
 
 
 
 
 
 
 
d94f2c6
 
91367ff
 
 
d94f2c6
 
12e34fc
b38be7b
d94f2c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import requests
import json

URL = "198.175.88.52"
myport = "8080"
gaudi_device_url = f"http://{URL}:{myport}/generate"
    
def text_gen(url, prompt):
    resp = requests.post(url, data=json.dumps(prompt))
    return resp.text
    
demo = gr.Interface(
    fn=text_gen,
    inputs=[gaudi_device_url, "text"],
    outputs=["text"])

demo.launch(share=True)