Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,10 +62,10 @@ def process_and_translate(text: str):
|
|
| 62 |
detected_context = detect_context(text)
|
| 63 |
|
| 64 |
try:
|
| 65 |
-
# Forward text
|
| 66 |
translation_response = requests.post(
|
| 67 |
-
"https://api.gradio.app/v2/Frenchizer/
|
| 68 |
-
json={"data": [text
|
| 69 |
).json()
|
| 70 |
|
| 71 |
if "error" in translation_response:
|
|
@@ -85,6 +85,7 @@ def process_and_translate(text: str):
|
|
| 85 |
"context": detected_context
|
| 86 |
})
|
| 87 |
|
|
|
|
| 88 |
# Define Gradio interface
|
| 89 |
with gr.Blocks() as interface:
|
| 90 |
input_text = gr.Textbox(label="Input Text")
|
|
|
|
| 62 |
detected_context = detect_context(text)
|
| 63 |
|
| 64 |
try:
|
| 65 |
+
# Forward only text to space_18 later we will forward according to the context
|
| 66 |
translation_response = requests.post(
|
| 67 |
+
"https://api.gradio.app/v2/Frenchizer/space_18/predict",
|
| 68 |
+
json={"data": [text]} # ⬅️ Now sending only `text`
|
| 69 |
).json()
|
| 70 |
|
| 71 |
if "error" in translation_response:
|
|
|
|
| 85 |
"context": detected_context
|
| 86 |
})
|
| 87 |
|
| 88 |
+
|
| 89 |
# Define Gradio interface
|
| 90 |
with gr.Blocks() as interface:
|
| 91 |
input_text = gr.Textbox(label="Input Text")
|