BasilTh commited on
Commit
bbe7b0d
·
1 Parent(s): 97664b5

Deploy updated SLM customer-support chatbot

Browse files
Files changed (1) hide show
  1. SLM_CService.py +3 -5
SLM_CService.py CHANGED
@@ -15,13 +15,11 @@ from peft import PeftModel
15
  conversation_history = []
16
 
17
  # 3) Model + adapter path in your repo (copied into the Space repo root)
18
- MODEL_DIR = "bitext-qlora-tinyllama"
19
 
20
  # 4) Load tokenizer from local dir
21
  tokenizer = AutoTokenizer.from_pretrained(
22
- MODEL_DIR,
23
- use_fast=False,
24
- local_files_only=True
25
  )
26
  tokenizer.pad_token_id = tokenizer.eos_token_id
27
  tokenizer.padding_side = "left"
@@ -43,7 +41,7 @@ model = unsloth.FastLanguageModel.from_pretrained(
43
  trust_remote_code=True
44
  )
45
  # 5b) Attach your LoRA adapter
46
- model = PeftModel.from_pretrained(model, MODEL_DIR, local_files_only=True)
47
 
48
  # 6) HF text-gen pipeline
49
  chat_pipe = pipeline(
 
15
  conversation_history = []
16
 
17
  # 3) Model + adapter path in your repo (copied into the Space repo root)
18
+ MODEL_DIR = "ThomasBasil/bitext-qlora-tinyllama"
19
 
20
  # 4) Load tokenizer from local dir
21
  tokenizer = AutoTokenizer.from_pretrained(
22
+ "ThomasBasil/bitext-qlora-tinyllama", use_fast=False
 
 
23
  )
24
  tokenizer.pad_token_id = tokenizer.eos_token_id
25
  tokenizer.padding_side = "left"
 
41
  trust_remote_code=True
42
  )
43
  # 5b) Attach your LoRA adapter
44
+ model = PeftModel.from_pretrained(model, "ThomasBasil/bitext-qlora-tinyllama")
45
 
46
  # 6) HF text-gen pipeline
47
  chat_pipe = pipeline(