Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
import requests
|
2 |
import json
|
3 |
import gradio as gr
|
|
|
4 |
|
5 |
# Define the function to call the API
|
6 |
def translate(text):
|
7 |
-
url =
|
|
|
8 |
payload = json.dumps({
|
9 |
"text": text
|
10 |
})
|
|
|
1 |
import requests
|
2 |
import json
|
3 |
import gradio as gr
|
4 |
+
import os
|
5 |
|
6 |
# Define the function to call the API
|
7 |
def translate(text):
|
8 |
+
url = os.getenv("TRANSLATION_API_URL")
|
9 |
+
#url = "https://xayq0bvi0h.execute-api.eu-west-2.amazonaws.com/api/translate"
|
10 |
payload = json.dumps({
|
11 |
"text": text
|
12 |
})
|