odaly commited on
Commit
86d3119
·
verified ·
1 Parent(s): 008983b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -93,7 +93,7 @@ max_length = st.sidebar.slider("Max Length", min_value=50, max_value=1024, value
93
  # Load the model and tokenizer
94
  @st.cache_resource
95
  def load_model_and_tokenizer():
96
- model_path = "C:/Users/MC/Ollama_UI/models--gpt2" # Path to the local model directory
97
 
98
  # Load model and tokenizer
99
  tokenizer = AutoTokenizer.from_pretrained(model_path) # Use GPT-2 tokenizer from Hugging Face
@@ -153,7 +153,7 @@ def save_chat_data(chat_data):
153
 
154
  # Function to handle uploaded text or PDF files and convert PDF to txt
155
  def handle_uploaded_file(uploaded_file):
156
- dataset_dir = "C:/Users/MC/Ollama_UI/datasets"
157
  dataset_path = Path(dataset_dir) / f"{uploaded_file.name}.txt"
158
 
159
  # Check if the file is a PDF
 
93
  # Load the model and tokenizer
94
  @st.cache_resource
95
  def load_model_and_tokenizer():
96
+ model_path = "gpt2" # Path to the local model directory
97
 
98
  # Load model and tokenizer
99
  tokenizer = AutoTokenizer.from_pretrained(model_path) # Use GPT-2 tokenizer from Hugging Face
 
153
 
154
  # Function to handle uploaded text or PDF files and convert PDF to txt
155
  def handle_uploaded_file(uploaded_file):
156
+ dataset_dir = "./datasets"
157
  dataset_path = Path(dataset_dir) / f"{uploaded_file.name}.txt"
158
 
159
  # Check if the file is a PDF