Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,7 @@ from io import BytesIO
|
|
| 13 |
import cohere
|
| 14 |
import os
|
| 15 |
import re
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
title = "# Welcome to AyaTonic"
|
|
@@ -22,6 +23,8 @@ load_dotenv()
|
|
| 22 |
COHERE_API_KEY = os.getenv('CO_API_KEY')
|
| 23 |
SEAMLESSM4T = os.getenv('SEAMLESSM4T')
|
| 24 |
|
|
|
|
|
|
|
| 25 |
inputlanguage = ""
|
| 26 |
producetext = "\n\nProduce a complete expositional blog post in {target_language} based on the above :"
|
| 27 |
formatinputstring = "\n\nthe above text is a learning aid. you must use rich text format to rewrite the above and add 1 . a red color tags for nouns 2. a blue color tag for verbs 3. a green color tag for adjectives and adverbs:"
|
|
@@ -175,8 +178,10 @@ iface = gr.Interface(
|
|
| 175 |
gr.File(label="File Upload"),
|
| 176 |
gr.Audio(sources="microphone", type="filepath", label="Mic Input"),
|
| 177 |
gr.Textbox(lines=2, label="Text Input"),
|
| 178 |
-
gr.Dropdown(choices=TEXT_SOURCE_LANGUAGE_NAMES, label="Input Language"),
|
| 179 |
-
gr.Dropdown(choices=TEXT_SOURCE_LANGUAGE_NAMES, label="Target Language")
|
|
|
|
|
|
|
| 180 |
],
|
| 181 |
outputs=[
|
| 182 |
RichTextbox(label="Processed Text"),
|
|
|
|
| 13 |
import cohere
|
| 14 |
import os
|
| 15 |
import re
|
| 16 |
+
import pandas as pd
|
| 17 |
|
| 18 |
|
| 19 |
title = "# Welcome to AyaTonic"
|
|
|
|
| 23 |
COHERE_API_KEY = os.getenv('CO_API_KEY')
|
| 24 |
SEAMLESSM4T = os.getenv('SEAMLESSM4T')
|
| 25 |
|
| 26 |
+
df = pd.read_csv("lang_list.csv")
|
| 27 |
+
|
| 28 |
inputlanguage = ""
|
| 29 |
producetext = "\n\nProduce a complete expositional blog post in {target_language} based on the above :"
|
| 30 |
formatinputstring = "\n\nthe above text is a learning aid. you must use rich text format to rewrite the above and add 1 . a red color tags for nouns 2. a blue color tag for verbs 3. a green color tag for adjectives and adverbs:"
|
|
|
|
| 178 |
gr.File(label="File Upload"),
|
| 179 |
gr.Audio(sources="microphone", type="filepath", label="Mic Input"),
|
| 180 |
gr.Textbox(lines=2, label="Text Input"),
|
| 181 |
+
# gr.Dropdown(choices=TEXT_SOURCE_LANGUAGE_NAMES, label="Input Language"),
|
| 182 |
+
# gr.Dropdown(choices=TEXT_SOURCE_LANGUAGE_NAMES, label="Target Language")
|
| 183 |
+
gr.Dropdown(choices=df["name"].to_list(), label="Input Language"),
|
| 184 |
+
gr.Dropdown(choices=df["name"].to_list(), label="Target Language")
|
| 185 |
],
|
| 186 |
outputs=[
|
| 187 |
RichTextbox(label="Processed Text"),
|