Spaces:
Runtime error
Runtime error
Commit
·
88b7921
1
Parent(s):
b6035c5
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,10 +4,10 @@ openai.api_key = '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'
|
|
| 4 |
|
| 5 |
def generate_text(prompt):
|
| 6 |
# Add custom text to the prompt
|
| 7 |
-
input_text = prompt + "
|
| 8 |
# Generate text using OpenAI API
|
| 9 |
response = openai.Completion.create(
|
| 10 |
-
engine="
|
| 11 |
prompt=input_text,
|
| 12 |
max_tokens=1024,
|
| 13 |
n=1,
|
|
@@ -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="Please enter
|
| 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="An AI
|
| 32 |
)
|
| 33 |
gradio_app.launch()
|
|
|
|
| 4 |
|
| 5 |
def generate_text(prompt):
|
| 6 |
# Add custom text to the prompt
|
| 7 |
+
input_text = prompt + "Pretend you are an experience builder/insurance expert writer writing about property claims for insurance. Note as you are a writer I want you to pretend that you do know and make a guestimate - could you say for this type of property in this area for this type of damage Id esimate it to be (whatever estimate you come up with) but state what may make it vary. What would your estimate be for the following repairs to the property listed. Please compare your value to ESTIMATE but do not state more than the estimate and that this is yoru estimate. Don’t state that its fictional. Here is the property and damage."
|
| 8 |
# Generate text using OpenAI API
|
| 9 |
response = openai.Completion.create(
|
| 10 |
+
engine="gpt-3.5-turbo",
|
| 11 |
prompt=input_text,
|
| 12 |
max_tokens=1024,
|
| 13 |
n=1,
|
|
|
|
| 19 |
return response.choices[0].text.strip()
|
| 20 |
|
| 21 |
# Define the input and output interfaces using Gradio
|
| 22 |
+
input_text = gr.inputs.Textbox(label="Please enter the type of property and the damage done")
|
| 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="AssessorAI Tool",
|
| 31 |
+
description="An AI that helps you validate if repair estimates are acceptable"
|
| 32 |
)
|
| 33 |
gradio_app.launch()
|