SivaResearch commited on
Commit
6c6637e
·
verified ·
1 Parent(s): 6fb7d93

update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -12
app.py CHANGED
@@ -1,10 +1,4 @@
1
-
2
-
3
-
4
  import whisper
5
-
6
-
7
-
8
  import torch
9
  from transformers import AutoTokenizer, AutoModelForCausalLM
10
  import gradio as gr
@@ -13,10 +7,7 @@ import gradio as gr
13
  Asr_model = whisper.load_model("base")
14
  Asr_model.device
15
 
16
-
17
-
18
  device = "cuda" if torch.cuda.is_available() else "cpu"
19
-
20
  model_name = "ai4bharat/Airavata"
21
 
22
  tokenizer = AutoTokenizer.from_pretrained(model_name, padding_side="left")
@@ -60,7 +51,6 @@ def inference(input_prompt, model, tokenizer):
60
  return output_text
61
 
62
 
63
-
64
  def transcribe(audio):
65
 
66
  #time.sleep(3)
@@ -91,6 +81,5 @@ demo = gr.Interface(
91
  title = 'CAMAI - Centralized Actionable Multimodal Agri Assistant on Edge Intelligence for Farmers ',
92
  fn=chat_interface,
93
  gr.inputs.Audio(source="microphone", type="filepath"),
94
- outputs=["textbox"],
95
- live=True)
96
  demo.launch()
 
 
 
 
1
  import whisper
 
 
 
2
  import torch
3
  from transformers import AutoTokenizer, AutoModelForCausalLM
4
  import gradio as gr
 
7
  Asr_model = whisper.load_model("base")
8
  Asr_model.device
9
 
 
 
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
11
  model_name = "ai4bharat/Airavata"
12
 
13
  tokenizer = AutoTokenizer.from_pretrained(model_name, padding_side="left")
 
51
  return output_text
52
 
53
 
 
54
  def transcribe(audio):
55
 
56
  #time.sleep(3)
 
81
  title = 'CAMAI - Centralized Actionable Multimodal Agri Assistant on Edge Intelligence for Farmers ',
82
  fn=chat_interface,
83
  gr.inputs.Audio(source="microphone", type="filepath"),
84
+ outputs=["textbox"] )
 
85
  demo.launch()