Code Monkey home page Code Monkey logo

Comments (18)

qiye45 avatar qiye45 commented on July 24, 2024 25

I also faced the same problem. The solution that worked for me is to install an older version of Gradio.
pip install gradio==3.50

from alpaca-lora.

alexandriabindas avatar alexandriabindas commented on July 24, 2024 16

gradio deprecated gradio.inputs and gradio.ouputs. Use gradio.components for newer versions. See example:

import gradio as gr

# Component eg. Image, Label ...etc

outputs=gr.components.<Component>(...) 
inputs=gr.components.<Component>(...)

from alpaca-lora.

rudza avatar rudza commented on July 24, 2024 15

I fixed the issues by using Components from gradio object directly.

from alpaca-lora.

RodolpheCalvet avatar RodolpheCalvet commented on July 24, 2024 12

pip install gradio==3.50 was ok tks

from alpaca-lora.

Wonderwill627 avatar Wonderwill627 commented on July 24, 2024 2

This does work thanks and good luck

!pip install gradio==3.43.1

from alpaca-lora.

wanyukang avatar wanyukang commented on July 24, 2024 1

pip install gradio==3.50 was ok tks

Actionable suggestions, thanks for sharing

from alpaca-lora.

rudza avatar rudza commented on July 24, 2024

Facing the same problem.

from alpaca-lora.

Muqi-Zou avatar Muqi-Zou commented on July 24, 2024

gradio-app/gradio#6384

from alpaca-lora.

Nimisha-Pabbichetty avatar Nimisha-Pabbichetty commented on July 24, 2024

I had the same issue as well, if you just want to generate outputs for some input prompts and you don't need to gradio interface then you can prompt the model like this: https://github.com/Nimisha-Pabbichetty/alpaca-lora/blob/main/generate.py

from alpaca-lora.

gaut9m avatar gaut9m commented on July 24, 2024

I am facing the same issue and gradio==3.50 does not seem to fix it

from alpaca-lora.

claverohub avatar claverohub commented on July 24, 2024

Hi! I'm very new in all of this so I'd appreciate your help.
As mention others, gradio==3.50 does not seem to fix it. After installing it, now I'm running app.py but then it shows the following message: ModuleNotFoundError: No module named 'distutils'
Python website mentions that distutils are now obsolete. So... I don't know what to do. Any idea?
Thanks!

from alpaca-lora.

BHEESETTIANAND avatar BHEESETTIANAND commented on July 24, 2024

AttributeError Traceback (most recent call last)
in <cell line: 3>()
2
3 demo = gr.Interface(
----> 4 fn=classify_audio, inputs=gr.Audio(type="filepath"), outputs=gr.outputs.Label()
5 )
6 demo.launch(debug=True)

AttributeError: module 'gradio' has no attribute 'outputs'

from alpaca-lora.

chiarapero1993 avatar chiarapero1993 commented on July 24, 2024

#@title Demo UI
import gradio as gr
import numpy as np

def generate_image(seed, c0, c1, c2, c3, c4, c5, c6):
seed = int(seed)
params = {'c0': c0,
'c1': c1,
'c2': c2,
'c3': c3,
'c4': c4,
'c5': c5,
'c6': c6}

# Assigns slider to the principal components
param_indexes = {'c0': 0,
          'c1': 1,
          'c2': 2,
          'c3': 3,
          'c4': 4,
          'c5': 5,
          'c6': 6}

# Save the values from the sliders
directions = []
distances = []
for k, v in params.items():
    directions.append(latent_dirs[param_indexes[k]])
    distances.append(v)

# Additional settings for image generation
start_layer = 0
end_layer = 14
truncation = 0.5

return display_sample_pytorch(seed, truncation, directions, distances, scale, int(start_layer), int(end_layer), disp=False)

Create a number input for seed

seed = gr.inputs.Number(default=0, label="Seed 1")

slider_max_val = 20
slider_min_val = -20
slider_step = 1

Create the sliders input

c0 = gr.inputs.Slider(label="Sleeve & Size", minimum=slider_min_val, maximum=slider_max_val, default=0)
c1 = gr.inputs.Slider(label="Dress - Jacket", minimum=slider_min_val, maximum=slider_max_val, default=0)
c2 = gr.inputs.Slider(label="Female Coat", minimum=slider_min_val, maximum=slider_max_val, default=0)
c3 = gr.inputs.Slider(label="Coat", minimum=slider_min_val, maximum=slider_max_val, default=0)
c4 = gr.inputs.Slider(label="Graphics", minimum=slider_min_val, maximum=slider_max_val, default=0)
c5 = gr.inputs.Slider(label="Dark", minimum=slider_min_val, maximum=slider_max_val, default=0)
c6 = gr.inputs.Slider(label="Less Cleavage", minimum=slider_min_val, maximum=slider_max_val, default=0)

inputs = [seed, c0, c1, c2, c3, c4, c5, c6]

Launch demo

gr.Interface(generate_image, inputs, ["image"], live=True, title="ClothingGAN").launch(debug=True)

AttributeError Traceback (most recent call last)
in <cell line: 39>()
37
38 # Create a number input for seed
---> 39 seed = gr.inputs.Number(default=0, label="Seed 1")
40
41 slider_max_val = 20

AttributeError: module 'gradio' has no attribute 'inputs'

from alpaca-lora.

Alchemist21 avatar Alchemist21 commented on July 24, 2024

This is so helpful. I was able to make it work when I realized gradio deprecated input/output into simply components. Thank you again @alexandrabindas

from alpaca-lora.

Elham-Keshavarz avatar Elham-Keshavarz commented on July 24, 2024

pip install gradio==3.50

thank you for sharing

from alpaca-lora.

OfficialLuciano avatar OfficialLuciano commented on July 24, 2024

I also faced the same problem. The solution that worked for me is to install an older version of Gradio. pip install gradio==3.50

Thank you very much.

from alpaca-lora.

sakjais avatar sakjais commented on July 24, 2024

I fixed the issues by using Components from gradio object directly.

Hey,
can you please tell the step for that

from alpaca-lora.

mahmoodalikhan1999 avatar mahmoodalikhan1999 commented on July 24, 2024

The error you people are encountering is due to using deprecated attribute names in Gradio. As of Gradio v3.0 and later, the module attributes inputs and outputs have been replaced with components.

You could use like gr.Textbox for both input and output

from alpaca-lora.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.