PD03 commited on
Commit
8353d84
·
verified ·
1 Parent(s): 18d932b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,17 +1,17 @@
1
  import pandas as pd
2
  import gradio as gr
3
  from transformers import pipeline
4
- from langchain.llms import HuggingFacePipeline
5
- from langchain.agents import create_pandas_dataframe_agent
6
 
7
  # Load your data
8
  df = pd.read_csv("synthetic_profit.csv")
9
 
10
- # Set up lightweight Hugging Face pipeline with Flan-T5 base
11
  hf_pipeline = pipeline(
12
  task="text2text-generation",
13
  model="google/flan-t5-base",
14
- device=-1 # ensures CPU
15
  )
16
 
17
  # LangChain agent setup
@@ -34,4 +34,4 @@ demo = gr.Interface(
34
  description="Ask questions about synthetic SAP profitability data. Powered by Flan-T5-base via Hugging Face."
35
  )
36
 
37
- demo.launch()
 
1
  import pandas as pd
2
  import gradio as gr
3
  from transformers import pipeline
4
+ from langchain_community.llms import HuggingFacePipeline
5
+ from langchain_experimental.agents import create_pandas_dataframe_agent
6
 
7
  # Load your data
8
  df = pd.read_csv("synthetic_profit.csv")
9
 
10
+ # Setup lightweight Hugging Face pipeline with Flan-T5 base
11
  hf_pipeline = pipeline(
12
  task="text2text-generation",
13
  model="google/flan-t5-base",
14
+ device=-1 # CPU only
15
  )
16
 
17
  # LangChain agent setup
 
34
  description="Ask questions about synthetic SAP profitability data. Powered by Flan-T5-base via Hugging Face."
35
  )
36
 
37
+ demo.launch()