Spaces:
Paused
Paused
remove some unused code
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ with open("example.txt") as f:
|
|
| 29 |
|
| 30 |
with gr.Blocks() as app:
|
| 31 |
def chat(text):
|
| 32 |
-
|
| 33 |
try:
|
| 34 |
response = palm.generate_text(
|
| 35 |
**defaults,
|
|
@@ -38,17 +38,12 @@ with gr.Blocks() as app:
|
|
| 38 |
input: {text}
|
| 39 |
fixed"""
|
| 40 |
)
|
| 41 |
-
f.write(f"""input: {text}\nfixed {response.result}\n""")
|
| 42 |
-
f.close()
|
| 43 |
|
| 44 |
return response.result
|
| 45 |
|
| 46 |
except:
|
| 47 |
result = "I am not able to correct the sentence given. Please try again."
|
| 48 |
-
|
| 49 |
-
fixed {result}\n""")
|
| 50 |
-
f.close()
|
| 51 |
-
|
| 52 |
return result
|
| 53 |
|
| 54 |
with gr.Column():
|
|
|
|
| 29 |
|
| 30 |
with gr.Blocks() as app:
|
| 31 |
def chat(text):
|
| 32 |
+
|
| 33 |
try:
|
| 34 |
response = palm.generate_text(
|
| 35 |
**defaults,
|
|
|
|
| 38 |
input: {text}
|
| 39 |
fixed"""
|
| 40 |
)
|
|
|
|
|
|
|
| 41 |
|
| 42 |
return response.result
|
| 43 |
|
| 44 |
except:
|
| 45 |
result = "I am not able to correct the sentence given. Please try again."
|
| 46 |
+
|
|
|
|
|
|
|
|
|
|
| 47 |
return result
|
| 48 |
|
| 49 |
with gr.Column():
|