Spaces:
Runtime error
Runtime error
Merge branch 'main' of https://huggingface.co/spaces/skoneru/Ensemble_Decoding into main
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ import gradio as gr
|
|
5 |
|
6 |
def translate(input_txt,prefix,suffix,num_beams,topk,beta):
|
7 |
dictToSend = {'input':input_txt,'prefix':prefix,'suffix':suffix,'num_beams':num_beams,'alpha': (1-beta),'beta':beta,'topk':topk}
|
8 |
-
res = requests.post('
|
9 |
-
return
|
10 |
|
11 |
prefix= "<s>[INST] <<SYS>>\nYou are a professional translator from English to German. You translate the sentences to only Formal German even if the English sentence is Informal.\n<</SYS>>\nEnglish: "
|
12 |
#self.prefix = "Translate from English to German:\nEnglish: "
|
|
|
5 |
|
6 |
def translate(input_txt,prefix,suffix,num_beams,topk,beta):
|
7 |
dictToSend = {'input':input_txt,'prefix':prefix,'suffix':suffix,'num_beams':num_beams,'alpha': (1-beta),'beta':beta,'topk':topk}
|
8 |
+
res = requests.post('https://d7bf-141-3-25-29.ngrok-free.app/generate', json=dictToSend)
|
9 |
+
return res.text
|
10 |
|
11 |
prefix= "<s>[INST] <<SYS>>\nYou are a professional translator from English to German. You translate the sentences to only Formal German even if the English sentence is Informal.\n<</SYS>>\nEnglish: "
|
12 |
#self.prefix = "Translate from English to German:\nEnglish: "
|