Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Duplicated from
templates/flask
Dooratre
/
flask
like
0
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
2529579
flask
/
app.py
Dooratre
Update app.py
fa21e2d
verified
11 months ago
raw
Copy download link
history
blame
Safe
227 Bytes
import
g4f
prompt =
'hello sir'
response = g4f.ChatCompletion.create(
model=
"gpt-4"
,
messages=[{
"role"
:
"user"
,
"content"
: prompt}],
stream=
True
,
)
for
message
in
response:
print
(message, flush=
True
, end=
''
)