Thibault Goehringer
commited on
Commit
·
ad45b04
1
Parent(s):
a19e447
Trying stuff out
Browse files
main.py
CHANGED
@@ -1,25 +1,7 @@
|
|
1 |
-
import
|
2 |
|
3 |
-
|
4 |
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
def prompt(tweet, roast=True):
|
11 |
-
roast_or_toast = "snarky joke" if roast else "encouragement"
|
12 |
-
return f"A user tweeted this tweet:\n\n{tweet}\\n\nThe following {roast_or_toast} was given as an answer:"
|
13 |
-
|
14 |
-
|
15 |
-
response = openai.Completion.create(
|
16 |
-
engine="text-davinci-002",
|
17 |
-
prompt=prompt(_tweet, roast=False),
|
18 |
-
temperature=0.7,
|
19 |
-
max_tokens=60,
|
20 |
-
top_p=1,
|
21 |
-
frequency_penalty=0,
|
22 |
-
presence_penalty=0
|
23 |
-
)
|
24 |
-
|
25 |
-
print(response.choices[0].text.strip())
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
|
3 |
+
app = FastAPI()
|
4 |
|
5 |
|
6 |
+
def read_root():
|
7 |
+
return {"Hello": "World!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|