Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -9,7 +9,7 @@ import replicate
|
|
9 |
|
10 |
class Item(BaseModel):
|
11 |
url: str
|
12 |
-
|
13 |
|
14 |
app = FastAPI()
|
15 |
|
@@ -71,7 +71,8 @@ async def root(item: Item):
|
|
71 |
def event_generator():
|
72 |
for event in replicate.stream("snowflake/snowflake-arctic-instruct", input={
|
73 |
"prompt": "summarize this following news article:" + article,
|
74 |
-
"temperature": 0.2
|
|
|
75 |
}):
|
76 |
# Yield the event as a string
|
77 |
yield str(event)
|
|
|
9 |
|
10 |
class Item(BaseModel):
|
11 |
url: str
|
12 |
+
max_tokens: int
|
13 |
|
14 |
app = FastAPI()
|
15 |
|
|
|
71 |
def event_generator():
|
72 |
for event in replicate.stream("snowflake/snowflake-arctic-instruct", input={
|
73 |
"prompt": "summarize this following news article:" + article,
|
74 |
+
"temperature": 0.2,
|
75 |
+
"max_new_tokens" : item.max_tokens
|
76 |
}):
|
77 |
# Yield the event as a string
|
78 |
yield str(event)
|