You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered:
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? 🔎
Reproduction
Screenshot
Logs
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: