Frenchizer commited on
Commit
82fd0e4
·
verified ·
1 Parent(s): c1151ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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 and detected context to space_7 for translation
66
  translation_response = requests.post(
67
- "https://api.gradio.app/v2/Frenchizer/space_7/predict",
68
- json={"data": [text, detected_context]}
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")