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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradio UI is not loading at local and public URL's #7438

Closed
1 task done
xxxmuzart opened this issue Feb 15, 2024 · 1 comment
Closed
1 task done

Gradio UI is not loading at local and public URL's #7438

xxxmuzart opened this issue Feb 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@xxxmuzart
Copy link

Describe the bug

I've run into a problem: when using the Gradio library, the local and public URL interface doesn't load. I tried restarting the script several times, but everything was unsuccessful.

Have you searched existing issues? 馃攷

  • I have searched and found no existing issues

Reproduction

from langchain_nvidia_ai_endpoints._common import NVEModel
from langchain_nvidia_ai_endpoints import ChatNVIDIA
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
import gradio as gr
import requests
import os


os.environ["NVIDIA_API_KEY"] = "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"
print(f"Retrieved NVIDIA_API_KEY beginning with \"{os.environ.get('NVIDIA_API_KEY')[:9]}...\"")


## Chat Pipeline
inst_llm = ChatNVIDIA(model="nv_llama2_rlhf_70b")  ## Models

prompt = ChatPromptTemplate.from_messages([
    ("system", "Friendly chatbot that helps people with their problems."),
    ("user", "previous conversations: {previous}. Input : {input}")
])

chain = prompt | inst_llm | StrOutputParser()  ## expects input and context

def chat_stream(message, history = []):
    buffer = ""
    for token in chain.stream({"input" : message, "previous" : history}):
        buffer += token
        yield buffer
    history.append([message, buffer])


gr.ChatInterface(chat_stream).queue().launch(debug=True, share=True)

Screenshot

image

Logs

Retrieved NVIDIA_API_KEY beginning with "nvapi-QOF..."
Running on local URL:  http://127.0.0.1:7861
Running on public URL: https://3cd74d86ddca0fd55b.gradio.live

This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)

System Info

Gradio Environment Information:
------------------------------
Operating System: Windows
gradio version: 4.16.0
gradio_client version: 0.8.1

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.2.0
fastapi: 0.108.0
ffmpy: 0.3.1
gradio-client==0.8.1 is not installed.
httpx: 0.24.1
huggingface-hub: 0.20.3
importlib-resources: 6.1.1
jinja2: 3.1.3
markupsafe: 2.1.4
matplotlib: 3.8.2
numpy: 1.26.3
orjson: 3.9.12
packaging: 23.2
pandas: 2.2.0
pillow: 10.2.0
pydantic: 2.5.3
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
ruff: 0.1.14
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.8.0
uvicorn: 0.25.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2023.10.0
httpx: 0.24.1
huggingface-hub: 0.20.3
packaging: 23.2
typing-extensions: 4.8.0
websockets: 11.0.3

Severity

Blocking usage of gradio

@xxxmuzart xxxmuzart added the bug Something isn't working label Feb 15, 2024
@abidlabs
Copy link
Member

Hi @xxxmuzart you've exposed your NVIDIA API key, please delete that key and create a new one!

Also, for share link related issues, please use this issue to discuss: #3677

I'll go ahead and close this issue to minimize visibility

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