wt002 commited on
Commit
2343396
·
verified ·
1 Parent(s): a37281a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -18
app.py CHANGED
@@ -2,7 +2,6 @@ import os
2
  import gradio as gr
3
  import requests
4
 
5
- import speech_recognition as sr
6
  from smolagents import OpenAIServerModel, DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool
7
  from pathlib import Path
8
  import tempfile
@@ -28,7 +27,7 @@ from langchain_community.document_loaders import (
28
  UnstructuredWordDocumentLoader
29
  )
30
  from langchain_community.utilities import TextRequestsWrapper
31
- import speech_recognition as sr
32
  from pydub import AudioSegment # For audio format conversion
33
 
34
  # (Keep Constants as is)
@@ -186,22 +185,6 @@ class BasicAgent:
186
  return self.agent.run(input_data)
187
  return "Unsupported input type"
188
 
189
- # Usage Example
190
- if __name__ == "__main__":
191
- agent = FullyOpenSourceAgent(model_name="mistral") # Try "llama3", "gemma", etc.
192
-
193
- # Example 1: Web search
194
- print(agent.run("Latest breakthroughs in renewable energy"))
195
-
196
- # Example 2: Process document
197
- print(agent.run({"file": "research.pdf"}))
198
-
199
- # Example 3: Complex workflow
200
- print(agent.run({
201
- "query": "Summarize the key points from this meeting recording",
202
- "file": "meeting.wav"
203
- }))
204
-
205
 
206
 
207
  def run_and_submit_all( profile: gr.OAuthProfile | None):
 
2
  import gradio as gr
3
  import requests
4
 
 
5
  from smolagents import OpenAIServerModel, DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool
6
  from pathlib import Path
7
  import tempfile
 
27
  UnstructuredWordDocumentLoader
28
  )
29
  from langchain_community.utilities import TextRequestsWrapper
30
+ #import speech_recognition as sr
31
  from pydub import AudioSegment # For audio format conversion
32
 
33
  # (Keep Constants as is)
 
185
  return self.agent.run(input_data)
186
  return "Unsupported input type"
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
 
189
 
190
  def run_and_submit_all( profile: gr.OAuthProfile | None):