raptor1 commited on
Commit
1445806
·
verified ·
1 Parent(s): 8154dac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -6,7 +6,6 @@ from transformers import T5Tokenizer, T5ForConditionalGeneration
6
 
7
  """The model and tokenizer must be properly initialized before we use the get_answer function otherwise it the UI will not show answers generated by the model because model has not generated any output yet."""
8
 
9
- from transformers import T5Tokenizer, T5ForConditionalGeneration
10
 
11
  # Initialize the tokenizer and model
12
  tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-base")
@@ -28,6 +27,12 @@ import pandas as pd
28
  data_url = "https://drive.google.com/uc?export=download&id=1O4CWfDo9h7MDK5KH5fktJeSTleoew6OY"
29
  """
30
 
 
 
 
 
 
 
31
 
32
  #creating dataframe
33
  df = pd.read_csv(data_url)
 
6
 
7
  """The model and tokenizer must be properly initialized before we use the get_answer function otherwise it the UI will not show answers generated by the model because model has not generated any output yet."""
8
 
 
9
 
10
  # Initialize the tokenizer and model
11
  tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-base")
 
27
  data_url = "https://drive.google.com/uc?export=download&id=1O4CWfDo9h7MDK5KH5fktJeSTleoew6OY"
28
  """
29
 
30
+ # Creating dataframe
31
+ try:
32
+ df = pd.read_csv('faqs.csv') # Load from the downloaded file
33
+ except Exception as e:
34
+ print(f"Error loading CSV: {e}")
35
+ raise
36
 
37
  #creating dataframe
38
  df = pd.read_csv(data_url)