Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradio Interface Not Generating Public Shareable URL #4596

Closed
1 task done
BTCBettor opened this issue Jun 21, 2023 · 1 comment
Closed
1 task done

Gradio Interface Not Generating Public Shareable URL #4596

BTCBettor opened this issue Jun 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@BTCBettor
Copy link

BTCBettor commented Jun 21, 2023

Describe the bug

I'm currently working on a project to create an AI chatbot using the OpenAI ChatGPT API with a Gradio interface. After following a step-by-step tutorial, I have encountered a problem in generating the public shareable URL.

Here's what I did:

  1. I wrote the code in a Python script (app.py) utilizing the gpt-3.5-turbo model and the Gradio interface for the web interface. I used my own API key in the process.
  2. I ran the script using the command python "C:\Users\X\Desktop\app.py" in the terminal.

After running the Python script, I could see the program generating a local URL, which works fine. However, the public URL, which should be provided for sharing the chatbot with others, is not being generated.

According to the Gradio documentation, setting the share=True parameter in gr.Interface() should create both a local and a public URL. In my case, it seems that this feature is not working as expected.

Upon running my Python script, a local URL is generated as expected, however, the public URL is not being generated. The error message I receive is:

Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.

Also please ensure that your antivirus or firewall is not blocking the binary file located at: C:\Users\X\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\frpc_windows_amd64_v0.2

Internet connection is working, Gradio is working, Firewall is disabled. But I can't find this file: frpc_windows_amd64_v0.2

Can anyone provide insights on why this might be happening and how I can resolve this? I need the public shareable URL for testing purposes outside of my local network.

Environment:
Python version: 3.11.4
Gradio version: 3.35.2
OS: Windows 10, Build 22621

Your help is greatly appreciated. Thank you.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import openai
import gradio as gr

openai.api_key = "Your API key"

messages = [
{"role": "system", "content": "You are a helpful and kind AI Assistant."},
]

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.inputs.Textbox(lines=7, label="Chat with AI")
outputs = gr.outputs.Textbox(label="Reply")

gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot",
description="Ask anything you want",
theme="compact").launch(share=True)

Screenshot

No response

Logs

No response

System Info

Name: gradio
Version: 3.35.2

Severity

Blocking usage of gradio

@BTCBettor BTCBettor added the bug Something isn't working label Jun 21, 2023
@abidlabs
Copy link
Member

Hi @BTCBettor this looks like a duplicate of #4548, we'll improve the messaging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants