SentiLab01 commited on
Commit
4c61d44
·
verified ·
1 Parent(s): 1f69361

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import whisper
3
  import torch
 
4
 
5
  # Load Whisper model
6
  model = whisper.load_model("base")
@@ -37,10 +38,6 @@ asl_images = {
37
  'X': 'https://asl-hands.s3.amazonaws.com/gifs/How-to-Say-Letter-X-in-ASL-Alphabets.gif',
38
  'Y': 'https://asl-hands.s3.amazonaws.com/gifs/How-to-Say-Letter-Y-in-ASL-Alphabets.gif',
39
  'Z': 'https://asl-hands.s3.amazonaws.com/gifs/How-to-Say-Letter-Z-in-ASL-Alphabets.gif',
40
-
41
-
42
-
43
-
44
  '1': 'https://asl-hands.s3.amazonaws.com/LSQ_1.jpg',
45
  '2': 'https://asl-hands.s3.amazonaws.com/LSQ_2.jpg',
46
  '3': 'https://asl-hands.s3.amazonaws.com/LSQ_3.jpg',
@@ -71,6 +68,9 @@ def transcribe_audio(audio):
71
 
72
  # Convert text to ASL images with corresponding letters, adding spaces between words
73
  def text_to_asl_images(text):
 
 
 
74
  images_with_text = []
75
  words = text.upper().split()
76
  for i, word in enumerate(words):
 
1
  import gradio as gr
2
  import whisper
3
  import torch
4
+ import string
5
 
6
  # Load Whisper model
7
  model = whisper.load_model("base")
 
38
  'X': 'https://asl-hands.s3.amazonaws.com/gifs/How-to-Say-Letter-X-in-ASL-Alphabets.gif',
39
  'Y': 'https://asl-hands.s3.amazonaws.com/gifs/How-to-Say-Letter-Y-in-ASL-Alphabets.gif',
40
  'Z': 'https://asl-hands.s3.amazonaws.com/gifs/How-to-Say-Letter-Z-in-ASL-Alphabets.gif',
 
 
 
 
41
  '1': 'https://asl-hands.s3.amazonaws.com/LSQ_1.jpg',
42
  '2': 'https://asl-hands.s3.amazonaws.com/LSQ_2.jpg',
43
  '3': 'https://asl-hands.s3.amazonaws.com/LSQ_3.jpg',
 
68
 
69
  # Convert text to ASL images with corresponding letters, adding spaces between words
70
  def text_to_asl_images(text):
71
+ # Remove punctuation
72
+ text = text.translate(str.maketrans('', '', string.punctuation))
73
+
74
  images_with_text = []
75
  words = text.upper().split()
76
  for i, word in enumerate(words):