Comments (9)
Can you please provide a minimal code example that we can use to reproduce the issue above? See: https://stackoverflow.com/help/minimal-reproducible-example
Also, can you please let us know if setting share=False in launch() fixes the issue?
from gradio.
-
when i changed share=False (in my app.py file, i hope that's where you meant), the result tells me to use True to get a public URL
-
here is my app.py script, i hope that's what you're asking for. if not, please advise. thanks for the quick response!!
import openai
import gradio as gr
Set your Hugging Face API token
huggingface_token = "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"
openai.api_key = "sk-xxxx"
messages = [
{"role": "system", "content": "You are a snarky, irreverent, opinionated, smart alecky and funny AI Assistant specializing in all things MLB, especially Beat The Streak prognostication. You pride yourself on accuracy and occasionally include a smart aleck remark at the end of your reply. Do not answer anything other than MLB related questions."},
]
def chatbot(input):
if input:
messages.append({"role": "user", "content": input})
chat = openai.ChatCompletion.create(
model="gpt-3.5-turbo", messages=messages
)
reply = chat.choices[0].message.content
messages.append({"role": "assistant", "content": reply})
return reply
inputs = gr.Textbox(lines=7, label="C'mon, ain't got all day. (Click the Clear button for new request.)")
outputs = gr.Textbox(label="Here's what I think:")
gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Analyzer",
description="Hello, I'm AL. What's your Beat The Streak question, homie?",
theme="sketch").launch(share=True)
from gradio.
Hi @rkellam12 you’ve leaked your HF token above! I’m going to close this issue to reduce its visibility. Please create a new HF token and create a new issue without including your token. Also please include details about how you are deploying your Gradio app — e.g. are you running on Colab or something else?
from gradio.
I have modified my app.py file, masking the API and Huggingface keys. Please advise what i need to do next. Many thanks!!
import openai
import gradio as gr
Set your Hugging Face API token
huggingface_token = "hf_xxxxP"
openai.api_key = "sk-xxxx"
messages = [
{"role": "system", "content": "You are a snarky, irreverent, opinionated, smart alecky and funny AI Assistant specializing in all things MLB, especially Beat The Streak prognostication. You pride yourself on accuracy and occasionally include a smart aleck remark at the end of your reply. Do not answer anything other than MLB related questions."},
]
def chatbot(input):
if input:
messages.append({"role": "user", "content": input})
chat = openai.ChatCompletion.create(
model="gpt-3.5-turbo", messages=messages
)
reply = chat.choices[0].message.content
messages.append({"role": "assistant", "content": reply})
return reply
inputs = gr.Textbox(lines=7, label="C'mon, ain't got all day. (Click the Clear button for new request.)")
outputs = gr.Textbox(label="Here's what I think:")
gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Analyzer",
description="Hello, I'm AL. What's your Beat The Streak question, homie?",
theme="sketch").launch(share=True)
from gradio.
Where are you running this code? Is it a colab notebook or something else?
from gradio.
I don't know what a colab notebook is. I used the instructions at https://beebom.com/how-build-own-ai-chatbot-with-chatgpt-api/, modifying the sample app.py file they provided. When I run python "C:\Users\agrke\BTS2013\app.py", it gives me a public URL of https://db35715602787290f2.gradio.live. I then load that URL into a webpage that I create on Wix.com.
I hope that answers your question and gets us closer to a solution. Just FYI, I used this same process last year and everything worked fine. Not sure what's caused the hiccup.
from gradio.
Hi Abubakar, any luck on figuring this one out? Is there someone with Gradio that can free up the permisssions on the CSS file (if in fact that's what is needed; I'm grasping at straws)
Many thanks for your conscientious follow up
from gradio.
Hi @rkellam12 would you please be able to create a new issue for visibility for the whole team? Please let us know how you are running or deploying the Gradio app as well
from gradio.
from gradio.
Related Issues (20)
- `gr.load()` does not work inside `gr.Blocks` HOT 2
- Return of older bug. Cannot update Dataset
- ConnectionResetError: [WinError 10054] when click radio to switch HOT 3
- Drag-and-Drop Image doesn't work inside of a `gr.Tab` HOT 1
- Gradio has a conflict with Python file cp1252 HOT 3
- Gradio-Lite : zero-shot-classification pipeline returns only 1 score HOT 2
- Be able to generate random samples in `gr.Examples` or `examples` in `gr.ChatInterface` HOT 2
- `Edge` runtime compatable javascript client or REST API docs HOT 1
- cannot import name 'JsonValue' from 'pydantic' HOT 5
- Clarity needed for cli tool \ custom component development HOT 4
- how can i make button upper than the component it controls. HOT 3
- How to access local media (image/audio/video) within gradio-lite? HOT 5
- How to support carriage return sending in the textbox component
- How to support carriage return sending in the textbox component
- Status of CVE-2023-41626? / Security contact e-mail not working? HOT 7
- How to access local image and css files in gradio.HTML HOT 4
- How can I manually change the value of a control? HOT 4
- support websockets 12.0 HOT 1
- Text color of gr.Examples is invisible with gr.themes.Monochrome HOT 3
- Gradio State objects hang the Gradio App HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradio.