Spaces:
Sleeping
Sleeping
alakxender
commited on
Commit
•
3a10e46
1
Parent(s):
c3c2f8f
ud
Browse files
README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
---
|
2 |
title: Dhivehi Text-Gen Goldfish Models
|
3 |
emoji: 🫧
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 5.8.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
short_description: goldfish-models/div_thaa_full demo
|
11 |
---
|
12 |
-
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
title: Dhivehi Text-Gen Goldfish Models
|
3 |
emoji: 🫧
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 5.8.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
short_description: goldfish-models/div_thaa_full demo
|
11 |
---
|
12 |
+
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -30,66 +30,55 @@ def generate_text(input_text):
|
|
30 |
|
31 |
# Create Gradio interface
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
}
|
41 |
-
"""
|
42 |
-
|
43 |
-
# Example inputs
|
44 |
-
examples = [
|
45 |
-
["ދިވެހިރާއްޖެ"],
|
46 |
-
["އެމެރިކާ އިންތިޚާބު"],
|
47 |
-
["ސަލާމް"],
|
48 |
-
["ދުނިޔޭގެ ސިއްޙަތު ޖަމްޢިއްޔާ"],
|
49 |
-
["ޤަދީމީ ސަގާފަތް"],
|
50 |
-
["ޑިމޮކްރަސީ"]
|
51 |
-
]
|
52 |
-
|
53 |
-
# Create Gradio app with modern components
|
54 |
-
with gr.Blocks(css=custom_css) as demo:
|
55 |
gr.Markdown("# Demo Dhivehi Text Generator")
|
56 |
gr.Markdown("Generate text in Dhivehi language. This model is trained to generate coherent text based on the input prompt.")
|
57 |
|
58 |
with gr.Row():
|
59 |
input_text = gr.Textbox(
|
60 |
-
label="Enter Dhivehi Text",
|
61 |
lines=2,
|
62 |
-
|
63 |
-
rtl=True
|
|
|
64 |
)
|
65 |
output_text = gr.Textbox(
|
66 |
-
label="Generated Text",
|
67 |
lines=2,
|
68 |
-
|
69 |
-
|
70 |
)
|
71 |
-
|
72 |
generate_btn = gr.Button("Generate")
|
73 |
generate_btn.click(
|
74 |
fn=generate_text,
|
75 |
inputs=input_text,
|
76 |
outputs=output_text
|
77 |
)
|
78 |
-
|
79 |
-
gr.
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
inputs=input_text,
|
82 |
outputs=output_text,
|
83 |
-
fn=generate_text
|
84 |
-
cache_examples=True
|
85 |
)
|
86 |
-
|
87 |
-
gr.Markdown("""
|
88 |
-
### Model Information
|
89 |
-
Model: Goldfish is a suite of monolingual language models trained for 350 languages.
|
90 |
-
This model is the Dhivehi (Thaana script). For more details, visit the
|
91 |
-
[Goldfish Models GitHub repository](https://github.com/tylerachang/goldfish).
|
92 |
-
""")
|
93 |
|
94 |
if __name__ == "__main__":
|
95 |
demo.launch()
|
|
|
30 |
|
31 |
# Create Gradio interface
|
32 |
|
33 |
+
with gr.Blocks(css="""
|
34 |
+
.thaana textarea {
|
35 |
+
font-size: 18px !important;
|
36 |
+
font-family: 'MV_Faseyha', 'Faruma', 'A_Faruma', 'Noto Sans Thaana', 'MV Boli';
|
37 |
+
line-height: 1.8 !important;
|
38 |
+
}
|
39 |
+
""") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
gr.Markdown("# Demo Dhivehi Text Generator")
|
41 |
gr.Markdown("Generate text in Dhivehi language. This model is trained to generate coherent text based on the input prompt.")
|
42 |
|
43 |
with gr.Row():
|
44 |
input_text = gr.Textbox(
|
|
|
45 |
lines=2,
|
46 |
+
label="Enter Dhivehi Text",
|
47 |
+
rtl=True,
|
48 |
+
elem_classes="thaana"
|
49 |
)
|
50 |
output_text = gr.Textbox(
|
|
|
51 |
lines=2,
|
52 |
+
rtl=True,
|
53 |
+
elem_classes="thaana"
|
54 |
)
|
55 |
+
|
56 |
generate_btn = gr.Button("Generate")
|
57 |
generate_btn.click(
|
58 |
fn=generate_text,
|
59 |
inputs=input_text,
|
60 |
outputs=output_text
|
61 |
)
|
62 |
+
|
63 |
+
gr.Markdown("""
|
64 |
+
Model: Goldfish is a suite of monolingual language models trained for 350 languages.
|
65 |
+
This model is the Dhivehi (Thaana script). For more details, visit the
|
66 |
+
[Goldfish Models GitHub repository](https://github.com/tylerachang/goldfish).
|
67 |
+
""")
|
68 |
+
|
69 |
+
examples = gr.Examples(
|
70 |
+
examples=[
|
71 |
+
["ދިވެހިރާއްޖެ"],
|
72 |
+
["އެމެރިކާ އިންތިޚާބު"],
|
73 |
+
["ސަލާމް"],
|
74 |
+
["ދުނިޔޭގެ ސިއްޙަތު ޖަމްޢިއްޔާ"],
|
75 |
+
["ޤަދީމީ ސަގާފަތް"],
|
76 |
+
["ޑިމޮކްރަސީ"]
|
77 |
+
],
|
78 |
inputs=input_text,
|
79 |
outputs=output_text,
|
80 |
+
fn=generate_text
|
|
|
81 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
if __name__ == "__main__":
|
84 |
demo.launch()
|