204 questions
Advice
0
votes
4
replies
85
views
Conceptual question about Client Server systems
My colleague and I are having a discussion about some client server system we are building. After eliminating the particular details it comes down to a very basic conceptual question.
A backend is of ...
0
votes
0
answers
41
views
Making gradio to refresh itself without blocking
I have this backend:
from fastapi import FastAPI, HTTPException
import uuid
import asyncio
import random
import time
from loguru import logger
import redis
from contextlib import asynccontextmanager
#...
0
votes
0
answers
25
views
Commit unable to auto-activate while using Gradio on Huggingface, but adding a blank line and commit it from the website works
I was trying to use Gradio in Huggingface Spaces. I added an app.py file in my VScode, and VScode told me that the push was all right. However, Huggingface Spaces declared "No application file&...
0
votes
0
answers
51
views
Gradio call spins with no output in Dockerfile
I am working on making a Docker container/image for an ML project that also has a Gradio instance. I would like to be able to spin up the gradio page in the docker instance and use that from a browser....
0
votes
0
answers
133
views
Can't get a real response from Vertex AI on Cloud Run
I'm new to Vertex AI/hosting things on Cloud Run.
I went to Prompt management, created a prompt, and clicked Build with code. Now my prompt is hosted on Google run in a Gradio app.
When I go to the ...
0
votes
1
answer
19
views
Clicking on an example so that it directly displays the expected output without requiring the user to press Enter?
I have a simple Gradio interface for machine translation:
How can I change it so that clicking on an example (e.g., 'Avion blanc') directly displays the translation without requiring the user to ...
2
votes
2
answers
122
views
How I can realtime update the Ui when I receive a request upon FastAPI?
I have this simple script:
import os
import gradio as gr
from fastapi import FastAPI, Request
import uvicorn
import threading
from typing import List
from datetime import datetime
api = FastAPI()
# ...
0
votes
1
answer
188
views
How to avoid auto-scroll when add a lot of text in a `TextArea` in Gradio?
In one adds a lot of text in a TextArea in Gradio, it auto-scrolls to the end of the text. Example:
import gradio as gr
def show_text():
return '\n'.join([f'test{i}' for i in range(50)]) # ...
1
vote
1
answer
125
views
Gradio "AttributeError: 'Image' object has no attribute 'proxy_url'"
Since the Gradio Discord server is busy or does not allow new requests, I'm posting this here. I intend to display an image in the rows of a Gradio Dataset. The error is "AttributeError: 'Image' ...
0
votes
0
answers
64
views
How to pass dynamic data to a Gradio Blocks on each FastAPI request?
I have a FastAPI app that serves different requests and on call of /chatbot
I want to render the Gradio block with some message that is passed dynamically to the app.
@app.get("/chatbot")
...
0
votes
0
answers
58
views
How to show generated image/chart saved in /temp folder in public Gradio app?
I'm using Gradio with share=True to launch a public app (*.gradio.live).
During the app's execution, I generate charts (e.g., Plotly) and save them as .html files inside a temporary folder like temp/...
0
votes
1
answer
52
views
sqlite table does not exist within gradio blocks or GradioUI even after creating said table
I am trying this out: https://huggingface.co/docs/smolagents/examples/text_to_sql in my hf space as a pro user.
For some reason GradioUI(agent).launch() can't detect the sqlite tables. even though the ...
0
votes
1
answer
56
views
gradio voice interface not launching from command line
I am trying to launch this simple gradio voice recording interface. It runs fine on Google Colab, but the same code acts differently from the command line and in Pycharm.
I am installing whisper with
...
0
votes
0
answers
170
views
Dynamic updates to Gradio layout
I am trying to work on a feature in the Gradio App, where the user selects a value from a dropdown, lets call this
PF dropdown. So different PFs have different number of output varibales and say ...
0
votes
0
answers
68
views
Gradio: Chatbot.copy event to allow change of text before copying it
In gradio, when a user copies the text generated by the LLM, this triggers the event ChatBot.copy, which is great. But the listener only gives you the copied text, and does not let you modify it.
In ...
0
votes
0
answers
156
views
Gradio dataframe dynamically changes its height
This is something that I have began noticing lately.
I have a dataframe in Gradio like
dataframe_output = gr.DataFrame(
label="Results Dataframe",
headers=[&...
0
votes
0
answers
127
views
How to access Gradio components created dynamically in a global function
My goal:
drop a list of files.
Read files and extract columns.
Dynamically generate dropdown componenets so the user can select the source and target columns.
I need to return (globally) all the ...
0
votes
0
answers
356
views
gradio UI Button and Image, image not shown after processing
I'm building a video analysis tool using Gradio as UI.
in the UI there is a dropdown and a textbox to select a local video, and some parameters to put in the text.
After clicking the load button, the ...
0
votes
1
answer
563
views
How to show dedicated progress bar in each tab in a Gradio app?
I am developing an image generation Gradio app that uses multiple models like SD3.5, Flux, and others to generate images from a given prompt.
The app has 7 tabs, each corresponding to a specific model....
0
votes
1
answer
298
views
How to dynamic serve gradio content in FastAPI on runtime?
I have a business request. I now have N gradio apps, the number increases and decreases dynamically, and the content will also changes.
So I want to look up the gradio app by id in a routing interface,...
1
vote
1
answer
425
views
gradio HTML component with <script> in head of gr.Block not working
I am trying to make a gr.HTML component to be clickable in order to set the display:block of a second gr.HTML component. For this I define a <script> block and add it the the head argument of gr....
1
vote
0
answers
384
views
Pyinstaller: ModuleNotFoundError: No module named 'gradio_rangeslider'
I am trying to package my python program using 'gradio' for the GUI and the custom gradio addon 'gradio_rangeslider' (by freddyaboulton on GitHub).
Previously I was unable to import gradio until I ...
1
vote
1
answer
135
views
Gradio Image() component to download image with random names
I have 3 gr.Image() where they only have output when the LLM inference happen.
img1 = gr.Image(
label="Generated Image",
type="pil",
format="png",
...
1
vote
1
answer
542
views
How to hide/disable processing time message?
I am using Gradio Blocks. Whenever the user sends a prompt, a spinner and a processing runtime message are shown.
There is a show_progress setting in the submit method but it allows to hide both the ...
0
votes
1
answer
133
views
How can I update display of chat history upon page refresh?
My chat UI using Gradio:
import sqlite3
import gradio as gr
import time
formatted_history = []
sqlite = None
def loadHistoryFromDB():
global sqlite,formatted_history
sql="SELECT role,...
3
votes
1
answer
736
views
RuntimeError: "Unused kwargs" and "frozenset object has no attribute discard" with BitsAndBytes bf16 Quantized Model in Hugging Face Gradio App
I'm encountering a RuntimeError while running a BitsAndBytes bf16 quantized Gemma-2-2b model on Hugging Face Spaces with a Gradio UI. The error specifically mentions unused kwargs and an ...
0
votes
1
answer
556
views
how to dynamically vertically scale layout with gr.Row() and multiple gr.Column() in Gradio
I need to build a layout in Gradio with two columns. The left column will contain several checkboxes, while the right column will feature a gr.Chatbot and a gr.TextBox. I want the gr.Chatbot component ...
0
votes
0
answers
91
views
Gradio & Blender Python API Conflict?
(Python 3.11)
I was trying to read a Blender file in Gradio, but something weird happened that I can't understand. Here is a simplified version of the problem I met today:
When I try to run this code ...
0
votes
1
answer
1k
views
how to add images in the markdown html gradio
i am adding images in my Gradio header, I explored the documentation and found that, it is allowed to keep markdown or html and load images and apply CSS on it to make it stylized, however I have ...
0
votes
1
answer
87
views
Gradio 5.0.2 Image: how to dispatch the start_recording event
On my WSL with Ubuntu 22.04 and Python 3.10 and Node 20.10, I would like to receive the "start_recording" event from gr.Image, running in "webcam" mode.
Since the event is ...
4
votes
1
answer
778
views
How can I adjust the height of a Gradio ChatInterface component using CSS?
I'm working on a chatbot interface using Gradio, and I'm trying to customize the height of the gr.ChatInterface component. I attempted to set the height using the height argument in the ChatInterface ...
1
vote
1
answer
276
views
gradio how to hide a webcam interface
In Python 3.10 with gradio 4.44.1 on Windows 10, I struggle to hide a webcam "live" image with a button click. Currently, I am stuck with the following code:
import gradio as gr
import numpy ...
1
vote
0
answers
223
views
Gradio progress Bar displays two times
I am working on my Gradio app in which i am using two Gradio components gr.HTML and gr.File . I have one button which calls one function through .click() method.
In function i have used progress bar ...
0
votes
2
answers
710
views
Gradio How to add user avatar in chat interface
I have a very basic code for Gradio chat interface, how can i add user avatar in Gradio chat interface
import gradio as gr
import random
import time
with gr.Blocks(theme=gr.themes.Soft()) as demo:
...
3
votes
1
answer
1k
views
how to change favicon in Gradio python
I have a very basic code for Gradio chat interface, how can i change favicon in Gradio chat interface
import time
import gradio as gr
def slow_echo(message, history):
for i in range(len(message)):
...
0
votes
1
answer
1k
views
Gradio app works fine using simple Dockerfile, but fails when using docker-compose
I have a simple gradio app that runs fine inside Docker, but fails when launched via docker-compose.
app.py
import gradio as gr
def greet(name):
return f"Hello {name}!"
iface = gr....
0
votes
0
answers
73
views
Why gradio image resizes the image in one environment?
I am running the same gradio script in two different computers.
It uses
image_display = gr.Image(label="Image Display", interactive=False)
however in one PC it shows the image occupying all ...
1
vote
0
answers
145
views
.select does not trigger
I want to create some circle on point clicked on a gradio image, here's my code
import gradio as gr
import numpy as np
#from Modules import calcs
# Global list to store clicked points
clicked_points = ...
0
votes
1
answer
536
views
Simple Gradio App in Docker Container does not work in Azure Container Registrey für Azure Webapp
I try to create a webapp in Azure, which uses a docker image for a python based Gradio app, which I pushed to my Azure Container Registry before.
I can't access the webapp via the default domain.
I ...
0
votes
1
answer
281
views
Response with Chart in Gradio
I see here some cases where plotly charts can be used (https://www.gradio.app/guides/creating-a-custom-chatbot-with-blocks) . I think the example with fig is broken here .
Does anybody have experience ...
0
votes
1
answer
77
views
Sequential bot messages in Gradio ChatInterface [closed]
Starting with very basic example :
import random
import gradio as gr
def random_response(message, history):
return random.choice(["Yes", "No"])
demo = gr.ChatInterface(...
0
votes
1
answer
801
views
Can't Install PIP Gradio
D:\XTTS-RVC-UI>pip install gradio
Collecting gradio
Using cached gradio-4.40.0-py3-none-any.whl.metadata (15 kB)
Collecting aiofiles<24.0,>=22.0 (from gradio)
Using cached aiofiles-23.2.1-...
1
vote
1
answer
520
views
FastAPI uvicorn starrlette gradio package errors
I am trying to upgrade a gradio app to the latest version. I have been able to get the app running again but it's throwing server errors when i go to the browser. I am getting the following errors ...
0
votes
1
answer
339
views
Can gradio functions return components
I want to use gradio to create a dropdown to choose a task id and fetch the json under that id and display it as custom component implemented under a block
An example of how this may work is something ...
0
votes
0
answers
428
views
Error with Tokenizer parallelism when using gradio and mlflow
I have written a script using gradio and sometimes (I emphasize this- only sometimes) when I run it I get
huggingface/tokenizers: The current process just got forked, after parallelism has already ...
1
vote
1
answer
336
views
Passing data to gradio Dataframe from JavaScript
I was making my own Bounding Box editor in gradio and succeeded to make some with written JS and HTML code using canvas, but now i need to pass an information from JS where boxes are drawn and saved ...
2
votes
1
answer
675
views
In a gradio tab GUI, a button calls the other tab
I have the following script
import gradio as gr
# Define the function for the first tab
def greet(text):
return f"Hello {text}"
# Define the function for the second tab
def farewell(...
2
votes
1
answer
2k
views
How to Load an Image onto a Canvas in Gradio with Custom HTML and JavaScript?
I am willing to make a bounding box editor implementation in gradio by creating html and js by myself (where user can move bboxes, scale and draw new ones). But i can't find a way to load an image to ...
0
votes
0
answers
559
views
Gradio Python - Passing Component Values to Function and Updating Interface
I am trying to implement a Gradio app that takes in a json of a conversation between users and an AI. The input json is formatted as such, where there are multiple conversations, each has an ...
2
votes
1
answer
193
views
Possible Way to have OpenAI code run on Flet?
I'm attempting to create a chatbot app for a project, I currently have everything running with OpenAI and Gradio. This is what my code looks like right now:
import openai
import gradio
openai....