mdsr commited on
Commit
b75d870
·
1 Parent(s): c3eb76b
Files changed (1) hide show
  1. app.py +9 -37
app.py CHANGED
@@ -42,39 +42,15 @@ CUSTOM_CSS = """
42
  }
43
  """
44
 
45
- try:
46
- HF_TOKEN = os.getenv("HF_TOKEN")
47
- request_logger = (
48
- gradio.HuggingFaceDatasetSaver(
49
- HF_TOKEN,
50
- "sltAI/crowdsourced-text-to-sign-language-rule-based-translation-corpus",
51
- )
52
- if HF_TOKEN
53
- else gradio.CSVLogger()
54
  )
55
- request_logger.setup(
56
- [
57
- gradio.Markdown(label="Spoken Language Sentence"),
58
- gradio.Markdown(label="Text Language"),
59
- gradio.Markdown(label="Sign Language"),
60
- gradio.Markdown(label="Exception"),
61
- gradio.Markdown(label="Timestamp"),
62
- ],
63
- "flagged",
64
- )
65
- request_logger = (
66
- gradio.HuggingFaceDatasetSaver(
67
- HF_TOKEN,
68
- "sltAI/crowdsourced-text-to-sign-language-rule-based-translation-corpus",
69
- )
70
- if HF_TOKEN
71
- else gradio.CSVLogger()
72
- )
73
- eroor_mesg = ""
74
- except Exception as e:
75
- request_logger = gradio.CSVLogger()
76
- eroor_mesg = f"Error in setting up HuggingFaceDatasetSaver: {e}"
77
- print(eroor_mesg)
78
 
79
  translation_model = slt.models.ConcatenativeSynthesis("ur", "pk-sl", "video")
80
  language_models: Dict[str, slt.models.BeamSampling] = {}
@@ -167,11 +143,7 @@ def translate(text: str, text_lang: str, sign_lang: str, sign_format: str):
167
 
168
  with gradio.Blocks(title=TITLE, head=CUSTOM_JS, css=CUSTOM_CSS) as gradio_app:
169
  gradio.Markdown(f"# {TITLE}")
170
- gradio.Markdown(
171
- DESCRIPTION + f"\n\n<sub>{eroor_mesg}<sub/>"
172
- if not isinstance(request_logger, gradio.HuggingFaceDatasetSaver)
173
- else ""
174
- )
175
  with gradio.Row(elem_classes=["reverse-row"]): # Inputs and Outputs
176
  with gradio.Column(): # Outputs
177
  gradio.Markdown("## Output Sign Language")
 
42
  }
43
  """
44
 
45
+ HF_TOKEN = os.getenv("HF_TOKEN")
46
+ request_logger = (
47
+ gradio.HuggingFaceDatasetSaver(
48
+ HF_TOKEN,
49
+ "sltAI/crowdsourced-text-to-sign-language-rule-based-translation-corpus",
 
 
 
 
50
  )
51
+ if HF_TOKEN
52
+ else gradio.CSVLogger()
53
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  translation_model = slt.models.ConcatenativeSynthesis("ur", "pk-sl", "video")
56
  language_models: Dict[str, slt.models.BeamSampling] = {}
 
143
 
144
  with gradio.Blocks(title=TITLE, head=CUSTOM_JS, css=CUSTOM_CSS) as gradio_app:
145
  gradio.Markdown(f"# {TITLE}")
146
+ gradio.Markdown(DESCRIPTION)
 
 
 
 
147
  with gradio.Row(elem_classes=["reverse-row"]): # Inputs and Outputs
148
  with gradio.Column(): # Outputs
149
  gradio.Markdown("## Output Sign Language")