| 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:esquiz-2023-09-25-22-27-57", | |
| prompt=prompt, | |
| max_tokens=30, | |
| temperature=0, | |
| stop=["_END"] | |
| ) | |
| return response.choices[0].text.strip() | |
| iface = gr.Interface(fn=generate_completion, | |
| inputs=gr.inputs.Textbox(lines=5, placeholder='Write the phrase or words here'), | |
| outputs='text', | |
| title="schizophrenia", | |
| description="Platform to detect potential schizophrenia symptoms, does not replace medical professionals. In the space you must write your discomfort or ailment and the respective ->, then you must click on send and the system will give you an answer on whether or not you have a potential symptom, or any recommendation. The axis of this artificial intelligence platform is based on transformer neural networks using the transfer learning technique and the fine tuning process.", | |
| input_labels="phrases", | |
| output_labels="forecast") | |
| iface.launch() |