freemt
commited on
Commit
•
f1b0e4e
1
Parent(s):
882d6ad
Debug
Browse files
app.py
CHANGED
@@ -24,10 +24,11 @@ def bloom_tr(prompt_, from_lang, to_lang, input_prompt="translate this", seed=2,
|
|
24 |
"""Translate via Bloom."""
|
25 |
prompt = dedent(
|
26 |
f"""
|
27 |
-
Instruction : Given an {from_lang} input sentence translate it into {to_lang} sentence. \n input :
|
28 |
-
|
29 |
).strip()
|
30 |
-
|
|
|
31 |
prompt = input_prompt
|
32 |
|
33 |
json_ = {
|
@@ -106,7 +107,7 @@ with demo:
|
|
106 |
dedent(
|
107 |
"""
|
108 |
## Model Details
|
109 |
-
Refer to the space created by [Kishore](https://www.linkedin.com/in/kishore-kunisetty-925a3919a/) in order to participate in [EuroPython22](https://huggingface.co/EuroPython2022)
|
110 |
please like his project to support his contribution to EuroPython22.
|
111 |
"""
|
112 |
).strip()
|
@@ -125,7 +126,7 @@ with demo:
|
|
125 |
|
126 |
input_prompt = gr.Textbox(
|
127 |
label="Enter a sentence: ",
|
128 |
-
value=
|
129 |
lines=4,
|
130 |
)
|
131 |
|
|
|
24 |
"""Translate via Bloom."""
|
25 |
prompt = dedent(
|
26 |
f"""
|
27 |
+
Instruction : Given an {from_lang} input sentence translate it into {to_lang} sentence. \n input : {prompt_} \n {to_lang} :
|
28 |
+
"""
|
29 |
).strip()
|
30 |
+
|
31 |
+
if not prompt:
|
32 |
prompt = input_prompt
|
33 |
|
34 |
json_ = {
|
|
|
107 |
dedent(
|
108 |
"""
|
109 |
## Model Details
|
110 |
+
Refer to [the space](https://huggingface.co/spaces/EuroPython2022/Translate-with-Bloom) created by [Kishore](https://www.linkedin.com/in/kishore-kunisetty-925a3919a/) in order to participate in [EuroPython22](https://huggingface.co/EuroPython2022)
|
111 |
please like his project to support his contribution to EuroPython22.
|
112 |
"""
|
113 |
).strip()
|
|
|
126 |
|
127 |
input_prompt = gr.Textbox(
|
128 |
label="Enter a sentence: ",
|
129 |
+
value="This is a test. Yet another test.",
|
130 |
lines=4,
|
131 |
)
|
132 |
|