Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- chat_csv.py +13 -0
- data_breast.csv +0 -0
- requirements.txt +2 -1
chat_csv.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langchain.llms import CTransformers
|
2 |
+
from langchain_experimental.agents.agent_toolkits.csv.base import create_csv_agent
|
3 |
+
|
4 |
+
llm = CTransformers(model="TheBloke/Llama-2-13B-Ensemble-v5-GGUF", model_file="llama-2-13b-ensemble-v5.Q5_K_M.gguf", model_type="llama")
|
5 |
+
|
6 |
+
csv_file = "/content/data_breast.csv"
|
7 |
+
|
8 |
+
agent = create_csv_agent(llm, csv_file, verbose=True)
|
9 |
+
|
10 |
+
def quiz(query):
|
11 |
+
return agent.run(query)
|
12 |
+
|
13 |
+
|
data_breast.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
requirements.txt
CHANGED
@@ -4,4 +4,5 @@ langchain
|
|
4 |
faiss-cpu
|
5 |
transformers
|
6 |
ctransformers>=0.2.24
|
7 |
-
sentence-transformers
|
|
|
|
4 |
faiss-cpu
|
5 |
transformers
|
6 |
ctransformers>=0.2.24
|
7 |
+
sentence-transformers
|
8 |
+
langchain-experimental==0.0.49
|