Petro commited on
Commit
2b482ed
1 Parent(s): af54df8
Files changed (2) hide show
  1. .gitattributes +1 -0
  2. main.py +2 -6
.gitattributes CHANGED
@@ -1,3 +1,4 @@
 
1
  *.7z filter=lfs diff=lfs merge=lfs -text
2
  *.arrow filter=lfs diff=lfs merge=lfs -text
3
  *.bin filter=lfs diff=lfs merge=lfs -text
 
1
+ *.gguf filter=lfs diff=lfs merge=lfs -text
2
  *.7z filter=lfs diff=lfs merge=lfs -text
3
  *.arrow filter=lfs diff=lfs merge=lfs -text
4
  *.bin filter=lfs diff=lfs merge=lfs -text
main.py CHANGED
@@ -1,10 +1,6 @@
1
- import os
2
-
3
  from ctransformers import AutoModelForCausalLM
4
  from fastapi import FastAPI
5
  from pydantic import BaseModel
6
- import requests
7
- from huggingface_hub import hf_hub_download
8
 
9
  file_name = "zephyr-7b-beta.Q4_K_S.gguf"
10
  llm = AutoModelForCausalLM.from_pretrained(file_name,
@@ -26,5 +22,5 @@ async def stream(item: validation):
26
  E_INST = "</s>"
27
  user, assistant = "<|user|>", "<|assistant|>"
28
  prompt = f"{system_prompt}{E_INST}\n{user}\n{item.prompt}{E_INST}\n{assistant}\n"
29
- # return llm(prompt)
30
- return prompt
 
 
 
1
  from ctransformers import AutoModelForCausalLM
2
  from fastapi import FastAPI
3
  from pydantic import BaseModel
 
 
4
 
5
  file_name = "zephyr-7b-beta.Q4_K_S.gguf"
6
  llm = AutoModelForCausalLM.from_pretrained(file_name,
 
22
  E_INST = "</s>"
23
  user, assistant = "<|user|>", "<|assistant|>"
24
  prompt = f"{system_prompt}{E_INST}\n{user}\n{item.prompt}{E_INST}\n{assistant}\n"
25
+
26
+ return llm(prompt)