MohamedRashad multimodalart HF Staff commited on
Commit
c01fc79
·
verified ·
1 Parent(s): 29f0e6f

feat: Enable MCP (#4)

Browse files

- feat: Enable MCP (18832a9021c9073a06dfa526a933fc65611b5c2a)


Co-authored-by: Apolinário from multimodal AI art <[email protected]>

Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -29,7 +29,21 @@ LANGUAGES = {
29
 
30
  @spaces.GPU()
31
  def process_audio(audio_path, model_name, lang_name, max_tokens=500):
32
- """Process audio with selected Voxtral model and return the generated response"""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  if not audio_path:
34
  return "Please upload an audio file."
35
 
@@ -111,4 +125,4 @@ with gr.Blocks(title="Voxtral Demo") as demo:
111
 
112
  # Launch the app
113
  if __name__ == "__main__":
114
- demo.queue().launch(share=False, ssr_mode=False)
 
29
 
30
  @spaces.GPU()
31
  def process_audio(audio_path, model_name, lang_name, max_tokens=500):
32
+ """Process audio with selected Voxtral model and return the generated response.
33
+
34
+ This function takes an audio file and processes it using the selected Voxtral model
35
+ to generate a transcription in the specified language.
36
+
37
+ Args:
38
+ audio_path: Path to the audio file to be transcribed.
39
+ model_name: Name of the Voxtral model to use ("Voxtral Mini (3B)" or "Voxtral Small (24B)").
40
+ lang_name: Name of the language for transcription (e.g., "English", "French", etc.).
41
+ max_tokens: Maximum number of tokens to generate in the output (default: 500).
42
+
43
+ Returns:
44
+ String containing the transcribed text from the audio file, or an error message
45
+ if the audio file is missing or an invalid model is selected.
46
+ """
47
  if not audio_path:
48
  return "Please upload an audio file."
49
 
 
125
 
126
  # Launch the app
127
  if __name__ == "__main__":
128
+ demo.queue().launch(share=False, ssr_mode=False, mcp_server=True)