Spaces:
Runtime error
Runtime error
Commit ·
cf96b71
1
Parent(s): af56ee5
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ openai.api_key = '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'
|
|
| 4 |
|
| 5 |
def generate_text(prompt):
|
| 6 |
# Add custom text to the prompt
|
| 7 |
-
input_text = prompt + "You are an expert
|
| 8 |
# Generate text using OpenAI API
|
| 9 |
response = openai.Completion.create(
|
| 10 |
engine="text-davinci-002",
|
|
@@ -19,7 +19,7 @@ def generate_text(prompt):
|
|
| 19 |
return response.choices[0].text.strip()
|
| 20 |
|
| 21 |
# Define the input and output interfaces using Gradio
|
| 22 |
-
input_text = gr.inputs.Textbox(label="
|
| 23 |
output_text = gr.outputs.Textbox(label="Generated text:")
|
| 24 |
|
| 25 |
# Create the Gradio app and run it
|
|
@@ -27,7 +27,7 @@ gradio_app = gr.Interface(
|
|
| 27 |
fn=generate_text,
|
| 28 |
inputs=input_text,
|
| 29 |
outputs=output_text,
|
| 30 |
-
title="
|
| 31 |
-
description="
|
| 32 |
)
|
| 33 |
gradio_app.launch()
|
|
|
|
| 4 |
|
| 5 |
def generate_text(prompt):
|
| 6 |
# Add custom text to the prompt
|
| 7 |
+
input_text = prompt + "You are an expert with many years experience in the insurance loss adjusting business. Can you give your expert opinion on the question or statement made at the start of this prompt.Make it accurate, but written in a simple and clear style."
|
| 8 |
# Generate text using OpenAI API
|
| 9 |
response = openai.Completion.create(
|
| 10 |
engine="text-davinci-002",
|
|
|
|
| 19 |
return response.choices[0].text.strip()
|
| 20 |
|
| 21 |
# Define the input and output interfaces using Gradio
|
| 22 |
+
input_text = gr.inputs.Textbox(label="What do you wish to know about insurance")
|
| 23 |
output_text = gr.outputs.Textbox(label="Generated text:")
|
| 24 |
|
| 25 |
# Create the Gradio app and run it
|
|
|
|
| 27 |
fn=generate_text,
|
| 28 |
inputs=input_text,
|
| 29 |
outputs=output_text,
|
| 30 |
+
title="AI Adjuster",
|
| 31 |
+
description="AI tool to help you understand and answer any insurance related queries."
|
| 32 |
)
|
| 33 |
gradio_app.launch()
|