Spaces:
Running
Running
Commit
ยท
a8d1661
1
Parent(s):
44cc67b
Update main.py
Browse files
main.py
CHANGED
@@ -9,10 +9,19 @@ from ctransformers import AutoModelForCausalLM
|
|
9 |
from pydantic import BaseModel
|
10 |
from sse_starlette.sse import EventSourceResponse
|
11 |
|
12 |
-
config = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
llm = AutoModelForCausalLM.from_pretrained('TheBloke/MPT-7B-Storywriter-GGML',
|
14 |
model_file='mpt-7b-storywriter.ggmlv3.q4_0.bin',
|
15 |
-
model_type='mpt')
|
16 |
app = fastapi.FastAPI()
|
17 |
app.add_middleware(
|
18 |
CORSMiddleware,
|
|
|
9 |
from pydantic import BaseModel
|
10 |
from sse_starlette.sse import EventSourceResponse
|
11 |
|
12 |
+
config = {
|
13 |
+
"temperature": 0.8,
|
14 |
+
"top_p": 0.95,
|
15 |
+
"top_k": 50,
|
16 |
+
"max_new_tokens": 1024,
|
17 |
+
"use_cache": True,
|
18 |
+
"do_sample": True,
|
19 |
+
"repetition_penalty": 1.02,
|
20 |
+
"max_seq_len": 4096
|
21 |
+
}
|
22 |
llm = AutoModelForCausalLM.from_pretrained('TheBloke/MPT-7B-Storywriter-GGML',
|
23 |
model_file='mpt-7b-storywriter.ggmlv3.q4_0.bin',
|
24 |
+
model_type='mpt', config=config)
|
25 |
app = fastapi.FastAPI()
|
26 |
app.add_middleware(
|
27 |
CORSMiddleware,
|