Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,6 @@ claim_text1 = "Car accident on highway, minor injuries, estimated damage $5000."
|
|
| 20 |
claim_text2 = "Car collision at intersection, severe injuries, estimated damage $15000."
|
| 21 |
|
| 22 |
def compare_claims(claim1, claim2):
|
| 23 |
-
try:
|
| 24 |
response = openai.ChatCompletion.create(
|
| 25 |
engine="gpt-4",
|
| 26 |
messages=[
|
|
@@ -29,8 +28,7 @@ try:
|
|
| 29 |
]
|
| 30 |
)
|
| 31 |
return response["choices"][0]["message"]["content"]
|
| 32 |
-
|
| 33 |
-
return {"error": str(e)}
|
| 34 |
|
| 35 |
def main():
|
| 36 |
"""
|
|
@@ -41,8 +39,8 @@ def main():
|
|
| 41 |
fn=compare_claims,
|
| 42 |
inputs=gr.Textbox(lines=2, placeholder="Enter Text Here..."),
|
| 43 |
outputs="json",
|
| 44 |
-
title="
|
| 45 |
-
description="
|
| 46 |
)
|
| 47 |
|
| 48 |
# Launch the Gradio app
|
|
|
|
| 20 |
claim_text2 = "Car collision at intersection, severe injuries, estimated damage $15000."
|
| 21 |
|
| 22 |
def compare_claims(claim1, claim2):
|
|
|
|
| 23 |
response = openai.ChatCompletion.create(
|
| 24 |
engine="gpt-4",
|
| 25 |
messages=[
|
|
|
|
| 28 |
]
|
| 29 |
)
|
| 30 |
return response["choices"][0]["message"]["content"]
|
| 31 |
+
|
|
|
|
| 32 |
|
| 33 |
def main():
|
| 34 |
"""
|
|
|
|
| 39 |
fn=compare_claims,
|
| 40 |
inputs=gr.Textbox(lines=2, placeholder="Enter Text Here..."),
|
| 41 |
outputs="json",
|
| 42 |
+
title="Claims Comparision",
|
| 43 |
+
description="Enter a sentence to see its classification."
|
| 44 |
)
|
| 45 |
|
| 46 |
# Launch the Gradio app
|