Neodranzer commited on
Commit
9a8cd2a
·
1 Parent(s): 5ff5c8e
__pycache__/llm_func.cpython-310.pyc ADDED
Binary file (908 Bytes). View file
 
__pycache__/main.cpython-310.pyc ADDED
Binary file (869 Bytes). View file
 
llm_func.py CHANGED
@@ -4,10 +4,9 @@ model = Llama.from_pretrained(repo_id="tensorblock/SmolLM-135M-Instruct-GGUF",fi
4
 
5
 
6
  def mdl(input):
7
- print(query)
8
- start = time.time()
9
- output = model(
10
- prompt=f"""<|im_start|>system
11
  You are a helpful chatbot.<|im_end|>
12
  <|im_start|>user
13
  {input}<|im_end|>""",
@@ -17,6 +16,6 @@ def mdl(input):
17
  echo=False,
18
  stop=["#"])
19
  end = time.time()
20
- total_time = end - start
21
- print(f"Execution time: {total_time:.2f} seconds")
22
  return output["choices"][0]["text"].replace('\nassistant\n','')
 
4
 
5
 
6
  def mdl(input):
7
+ print(input)
8
+ start = time.time()
9
+ output = model(prompt=f"""<|im_start|>system
 
10
  You are a helpful chatbot.<|im_end|>
11
  <|im_start|>user
12
  {input}<|im_end|>""",
 
16
  echo=False,
17
  stop=["#"])
18
  end = time.time()
19
+ total_time = end - start
20
+ print(f"Execution time: {total_time:.2f} seconds")
21
  return output["choices"][0]["text"].replace('\nassistant\n','')
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
  fastapi
2
  uvicorn
3
  llama-cpp-python==0.3.6 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
4
- huggingface
 
 
1
  fastapi
2
  uvicorn
3
  llama-cpp-python==0.3.6 --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
4
+ huggingface
5
+ huggingface-hub