Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ headers = {"Authorization": f"Bearer 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"}
|
|
9 |
def translate(prompt_ , from_lang, to_lang, input_prompt = "translate this", seed = 42):
|
10 |
|
11 |
|
12 |
-
prompt = f"To say \"{prompt_}\" in {to_lang}, you would say
|
13 |
print(prompt)
|
14 |
if len(prompt) == 0:
|
15 |
prompt = input_prompt
|
@@ -37,7 +37,7 @@ def translate(prompt_ , from_lang, to_lang, input_prompt = "translate this", see
|
|
37 |
}
|
38 |
response = requests.post(API_URL, json=json_, headers=headers)
|
39 |
print(f"Response is : {response}")
|
40 |
-
output = response.json()
|
41 |
print(f"output is : {output}")
|
42 |
#output = json.loads(response.content.decode("utf-8"))
|
43 |
output_tmp = output[0]['generated_text']
|
|
|
9 |
def translate(prompt_ , from_lang, to_lang, input_prompt = "translate this", seed = 42):
|
10 |
|
11 |
|
12 |
+
prompt = f"To say \"{prompt_}\" in {to_lang}, you would say"
|
13 |
print(prompt)
|
14 |
if len(prompt) == 0:
|
15 |
prompt = input_prompt
|
|
|
37 |
}
|
38 |
response = requests.post(API_URL, json=json_, headers=headers)
|
39 |
print(f"Response is : {response}")
|
40 |
+
output = json.loads(response.content.decode("utf-8"))#response.json()
|
41 |
print(f"output is : {output}")
|
42 |
#output = json.loads(response.content.decode("utf-8"))
|
43 |
output_tmp = output[0]['generated_text']
|