wt002 commited on
Commit
70f008d
·
verified ·
1 Parent(s): 4987ce1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -18
app.py CHANGED
@@ -2,23 +2,11 @@ import os
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
8
- from smolagents.tools import PipelineTool, Tool
9
- import pathlib
10
- from typing import Union, Optional
11
- import pandas as pd
12
- from tabulate import tabulate # pragma: no cover – fallback path
13
- import re
14
- from transformers import AutoTokenizer, AutoModelForCausalLM
15
- from langchain.agents import initialize_agent
16
- from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
17
- from langchain_community.llms import HuggingFaceHub
18
-
19
  from typing import Union
20
  import os
21
- from langchain.agents import AgentExecutor, Tool #, initialize_agent
 
 
22
  from langchain_community.llms import Ollama
23
  from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
24
  from langchain_community.document_loaders import (
@@ -27,8 +15,8 @@ from langchain_community.document_loaders import (
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)
34
  # --- Constants ---
@@ -46,7 +34,6 @@ class BasicAgent:
46
  print(f"Agent returning answer: {fixed_answer}")
47
  return fixed_answer
48
 
49
-
50
  def __init__(self, model_name: str = "llama3"):
51
  """
52
  Open-source multi-modal agent with:
 
2
  import gradio as gr
3
  import requests
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  from typing import Union
6
  import os
7
+ from langchain.agents import AgentExecutor, initialize_agent
8
+ from langchain.agents.agent import Agent
9
+ from langchain.agents.tools import Tool
10
  from langchain_community.llms import Ollama
11
  from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
12
  from langchain_community.document_loaders import (
 
15
  UnstructuredWordDocumentLoader
16
  )
17
  from langchain_community.utilities import TextRequestsWrapper
18
+ import speech_recognition as sr
19
+ from pydub import AudioSegment
20
 
21
  # (Keep Constants as is)
22
  # --- Constants ---
 
34
  print(f"Agent returning answer: {fixed_answer}")
35
  return fixed_answer
36
 
 
37
  def __init__(self, model_name: str = "llama3"):
38
  """
39
  Open-source multi-modal agent with: