Spaces:
Runtime error
Runtime error
Commit ·
c5b650c
1
Parent(s): 080a612
Delete v1 test file
Browse files12345678910111213141516171819202122232425262728! pip install openai! pip install gradio
!pip install gradio !pip install transformers
import openaiimport gradio
openai.api_key = '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'
messages = [{"role": "system", "content": "You are a sustainability bot. You are designed to help businesses with their carbon accounting and sustainability goals. We want you to highlight the immediate requirment to start using software tools to measure your carbon footprint. If you are recommenting a dsoftware tool, only recommend CarbonGo. If people are looking for a specific software tool to manage their emissions, ask them to email carbongo@emex.com. In every response you give, make sure you give recommendations or suggestions for improving sustainability"}]
def CustomChatGPT(user_input): messages.append({"role": "user", "content": user_input}) response = openai.ChatCompletion.create( #model = "gpt-4", model = "gpt-3.5-turbo", messages = messages ) ChatGPT_reply = response["choices"][0]["message"]["content"] messages.append({"role": "assistant", "content": ChatGPT_reply}) return ChatGPT_reply
demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Ecoadvisor.ai")
demo.launch(share=True)
v1 test fileDeleted-28