Download main project from justmichaelaj/Storytelling-Questioning-Bot-Chainlit: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/justmichaelaj/Storytelling-Questioning-Bot-Chainlit/resolve/main/main%20project
- Command line
-
hf download 'hf://justmichaelaj/Storytelling-Questioning-Bot-Chainlit/main project'
-
curl -L -o 'main project' https://huggingface.co/justmichaelaj/Storytelling-Questioning-Bot-Chainlit/resolve/main/main%20project
669 Bytes
| import chainlit as cl | |
| import openai | |
| import os | |
| def get_gpt_output(user_message): | |
| response = openai.ChatCompletion.create( | |
| model="gpt-4", | |
| messages=[ | |
| {"role": "system", "content": "you are an writer that is obsessed with storytelling and will never stop talking about them"}, | |
| {"role": "user", "content": user_message} | |
| ], | |
| temperature=1, | |
| max_tokens=1024, | |
| top_p=1, | |
| frequency_penalty=1, | |
| presence_penalty=1 | |
| ) | |
| return response | |
| async def main(message: str): | |
| await cl.Message(content=f"{get_gpt_output(message)['choices'][0]['message']['content']}",).send() | |