Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
@@ -25,9 +25,6 @@ def translate(prompt_ , from_lang, to_lang, input_prompt = "translate this", see
|
|
25 |
"do_sample": True,
|
26 |
"num_beams": 3,
|
27 |
"seed": seed,
|
28 |
-
"early_stopping": False,
|
29 |
-
"length_penalty": 0.0,
|
30 |
-
"eos_token_id": None,
|
31 |
"repetition_penalty": 3.0,
|
32 |
},
|
33 |
"options": {
|
@@ -35,7 +32,7 @@ def translate(prompt_ , from_lang, to_lang, input_prompt = "translate this", see
|
|
35 |
"wait_for_model": True,
|
36 |
},
|
37 |
}
|
38 |
-
response = requests.post(API_URL, json=json_)
|
39 |
print(f"Response is : {response}")
|
40 |
output = json.loads(response.content.decode("utf-8"))#response.json()
|
41 |
print(f"output is : {output}")
|
@@ -62,12 +59,13 @@ with demo:
|
|
62 |
from_lang = gr.Dropdown(['English', 'Spanish', 'Hindi' , 'Bangla'],
|
63 |
value='English',
|
64 |
label='select From language : ')
|
|
|
65 |
to_lang = gr.Dropdown(['English', 'Spanish', 'Hindi'],
|
66 |
value='Hindi',
|
67 |
label= 'select to Language : ')
|
68 |
|
69 |
input_prompt = gr.Textbox(label="Enter the sentence : ",
|
70 |
-
value=f"
|
71 |
lines=6)
|
72 |
|
73 |
generated_txt = gr.Textbox(lines=3)
|
|
|
25 |
"do_sample": True,
|
26 |
"num_beams": 3,
|
27 |
"seed": seed,
|
|
|
|
|
|
|
28 |
"repetition_penalty": 3.0,
|
29 |
},
|
30 |
"options": {
|
|
|
32 |
"wait_for_model": True,
|
33 |
},
|
34 |
}
|
35 |
+
response = requests.post(API_URL, headers=headers, json=json_)
|
36 |
print(f"Response is : {response}")
|
37 |
output = json.loads(response.content.decode("utf-8"))#response.json()
|
38 |
print(f"output is : {output}")
|
|
|
59 |
from_lang = gr.Dropdown(['English', 'Spanish', 'Hindi' , 'Bangla'],
|
60 |
value='English',
|
61 |
label='select From language : ')
|
62 |
+
with gr.Row():
|
63 |
to_lang = gr.Dropdown(['English', 'Spanish', 'Hindi'],
|
64 |
value='Hindi',
|
65 |
label= 'select to Language : ')
|
66 |
|
67 |
input_prompt = gr.Textbox(label="Enter the sentence : ",
|
68 |
+
value=f"Please write the text here :",
|
69 |
lines=6)
|
70 |
|
71 |
generated_txt = gr.Textbox(lines=3)
|