wakeupmh commited on
Commit
03e43ae
·
1 Parent(s): 1436681

feat: add tokenizer model and summarization model

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -16,15 +16,16 @@ logging.basicConfig(level=logging.INFO)
16
  DATA_DIR = "/data" if os.path.exists("/data") else "."
17
  DATASET_DIR = os.path.join(DATA_DIR, "rag_dataset")
18
  DATASET_PATH = os.path.join(DATASET_DIR, "dataset")
19
- MODEL_PATH = "deepseek-ai/DeepSeek-R1-Distill-Llama-8B" # Using flan-t5-small for better performance
 
20
 
21
  @st.cache_resource
22
  def load_local_model():
23
  """Load the local Hugging Face model"""
24
  try:
25
- tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
26
  model = T5ForConditionalGeneration.from_pretrained(
27
- MODEL_PATH,
28
  device_map={"": "cpu"}, # Force CPU
29
  torch_dtype=torch.float32
30
  )
 
16
  DATA_DIR = "/data" if os.path.exists("/data") else "."
17
  DATASET_DIR = os.path.join(DATA_DIR, "rag_dataset")
18
  DATASET_PATH = os.path.join(DATASET_DIR, "dataset")
19
+ TOKENIZER_MODEL = "google/flan-t5-small"
20
+ SUMMARIZATION_MODEL= "Falconsai/text_summarization"
21
 
22
  @st.cache_resource
23
  def load_local_model():
24
  """Load the local Hugging Face model"""
25
  try:
26
+ tokenizer = AutoTokenizer.from_pretrained(TOKENIZER_MODEL)
27
  model = T5ForConditionalGeneration.from_pretrained(
28
+ SUMMARIZATION_MODEL,
29
  device_map={"": "cpu"}, # Force CPU
30
  torch_dtype=torch.float32
31
  )