File size: 851 Bytes
eb9dec2
 
 
 
 
 
 
 
 
 
 
 
 
0f51710
eb9dec2
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
import openai
def generate_completion(user_prompt):
    hidden_context = " "
    prompt = hidden_context + user_prompt
    response = openai.Completion.create(
        model="davinci:ft-topwow-llc:gastrictumor-2023-09-15-02-11-18",
        prompt=prompt,
        max_tokens=10,
        temperature=0
    )
    return response.choices[0].text.strip()
iface = gr.Interface(fn=generate_completion,
                     inputs=gr.inputs.Textbox(lines=5, placeholder=''),
                     outputs='text',
                     title="Detector of potential symptoms of gastric cancer",
                     description=" Platform that detects potential symptoms of gastric tumor. Write the phrase and add the arrow -> plus three spaces, example: I have intense pain in the pit of my stomach -> ",
                     )
iface.launch()