ABIcode23 commited on
Commit
7353fdb
·
verified ·
1 Parent(s): 701388d

Upload 4 files

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -30,8 +30,7 @@ async def load_model():
30
  logger.info("Loading base model...")
31
  base_model = AutoModelForCausalLM.from_pretrained(
32
  "mistralai/Mistral-7B-Instruct-v0.3",
33
- token=hf_token if hf_token else None,
34
- use_auth_token=True if not hf_token else None
35
  )
36
 
37
  logger.info("Loading PEFT model...")
@@ -40,8 +39,7 @@ async def load_model():
40
  logger.info("Loading tokenizer...")
41
  tokenizer = AutoTokenizer.from_pretrained(
42
  "mistralai/Mistral-7B-Instruct-v0.3",
43
- token=hf_token if hf_token else None,
44
- use_auth_token=True if not hf_token else None
45
  )
46
 
47
  logger.info("Creating pipeline...")
@@ -70,4 +68,4 @@ async def generate(text: str):
70
 
71
  if __name__ == "__main__":
72
  import uvicorn
73
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
30
  logger.info("Loading base model...")
31
  base_model = AutoModelForCausalLM.from_pretrained(
32
  "mistralai/Mistral-7B-Instruct-v0.3",
33
+ use_auth_token=hf_token
 
34
  )
35
 
36
  logger.info("Loading PEFT model...")
 
39
  logger.info("Loading tokenizer...")
40
  tokenizer = AutoTokenizer.from_pretrained(
41
  "mistralai/Mistral-7B-Instruct-v0.3",
42
+ use_auth_token=hf_token
 
43
  )
44
 
45
  logger.info("Creating pipeline...")
 
68
 
69
  if __name__ == "__main__":
70
  import uvicorn
71
+ uvicorn.run(app, host="0.0.0.0", port=7860)