riokorb commited on
Commit
7ac3140
·
verified ·
1 Parent(s): db70dbc

Updated libraries and requirements to fix import errors

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +6 -23
app.py CHANGED
@@ -8,7 +8,7 @@ from dotenv import load_dotenv
8
  # LlamaIndex Imports
9
  from llama_index.core.llms import LLM
10
  from llama_index.llms.gemini import Gemini
11
- from llama_index.llms.huggingface import HuggingFaceInferenceAPI
12
  from llama_index.core.tools import BaseTool
13
  from llama_index.core.agent import ReActAgent
14
  from llama_index.core.memory import ChatMemoryBuffer
@@ -59,7 +59,7 @@ class BasicAgent:
59
  if not api_key:
60
  raise ValueError("HUGGINGFACE_API_KEY not found in environment variables")
61
 
62
- return HuggingFaceInferenceAPI(
63
  model_name="mistralai/Mistral-7B-Instruct-v0.2",
64
  api_key=api_key,
65
  temperature=0.1,
 
8
  # LlamaIndex Imports
9
  from llama_index.core.llms import LLM
10
  from llama_index.llms.gemini import Gemini
11
+ from llama_index.llms.huggingface import HuggingFaceInference
12
  from llama_index.core.tools import BaseTool
13
  from llama_index.core.agent import ReActAgent
14
  from llama_index.core.memory import ChatMemoryBuffer
 
59
  if not api_key:
60
  raise ValueError("HUGGINGFACE_API_KEY not found in environment variables")
61
 
62
+ return HuggingFaceInference(
63
  model_name="mistralai/Mistral-7B-Instruct-v0.2",
64
  api_key=api_key,
65
  temperature=0.1,
requirements.txt CHANGED
@@ -1,28 +1,11 @@
1
  gradio
2
  requests
3
  pandas
4
- llama-index
5
- llama-index-llms-gemini
6
- llama-index-llms-huggingface
7
- llama-index-readers-web
8
- llama-index-readers-wikipedia
9
  python-dotenv
10
 
11
- # The following are commented out as they're not needed for our simplified approach
12
- # llama-index-vector-stores-chroma
13
- # llama-index-postprocessor-colbert-rerank
14
- # llama_index.embeddings.huggingface
15
- # chromadb
16
-
17
- # llama-index>=0.9.0
18
- # llama-index-llms-gemini>=0.1.0
19
- # llama-index-llms-huggingface>=0.1.0
20
- # llama-index-readers-web>=0.1.0
21
- # llama-index-readers-wikipedia>=0.1.0
22
- # llama-index-vector-stores-chroma>=0.1.0
23
- # llama-index-postprocessor-colbert-rerank>=0.1.0
24
- # chromadb>=0.4.18
25
- # python-dotenv>=1.0.0
26
- # gradio>=4.0.0
27
- # pandas>=2.0.0
28
- # requests>=2.31.0
 
1
  gradio
2
  requests
3
  pandas
 
 
 
 
 
4
  python-dotenv
5
 
6
+ # LlamaIndex packages with specific version to ensure compatibility
7
+ llama-index>=0.10.0
8
+ llama-index-llms-gemini>=0.1.0
9
+ llama-index-llms-huggingface>=0.1.0
10
+ llama-index-readers-web>=0.1.0
11
+ llama-index-readers-wikipedia>=0.1.0