Comments (18)
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.
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.
I fixed the issues by using Components from gradio
object directly.
from alpaca-lora.
pip install gradio==3.50 was ok tks
from alpaca-lora.
This does work thanks and good luck
!pip install gradio==3.43.1
from alpaca-lora.
pip install gradio==3.50 was ok tks
Actionable suggestions, thanks for sharing
from alpaca-lora.
Facing the same problem.
from alpaca-lora.
from alpaca-lora.
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.
I am facing the same issue and gradio==3.50 does not seem to fix it
from alpaca-lora.
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.
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.
#@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.
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.
pip install gradio==3.50
thank you for sharing
from alpaca-lora.
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.
I fixed the issues by using Components from
gradio
object directly.
Hey,
can you please tell the step for that
from alpaca-lora.
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)
- Are the saved models (either adapter_model.bin or pytorch_model.bin) only 25-26MB in size? HOT 5
- generate error HOT 1
- can't load tokenizer HOT 2
- Load_in_8bit causing issues: Out of memory error with 44Gb VRAM in my GPU or device_map error HOT 1
- When I set load_in_8bit=true, some errors occurred....
- is there any flag to mark the model is safetensors or pickle format?
- Errors of tuning on 70B LLAMA 2, does alpaca-lora support 70B llama 2 tuning work?
- safetensors_rust.SafetensorError: Error while deserializing header: InvalidHeaderDeserialization HOT 15
- generate error after hit submit btn
- The weights are not updated HOT 1
- LAION Open Assistant data is already released
- Loading a quantized checkpoint into non-quantized Linear8bitLt is not supported
- Is it possible to combine alpaca-lora with RAG
- Is there a way to check if this training is all done?
- failed to run on colab: ModulesToSaveWrapper has no attribute `embed_tokens`
- Finetune scenarios
- decapoda-research/llama-7b-hf is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' HOT 2
- Single GPU vs multiple GPUs stack (parallel)
- Why this error? ValueError: We need an `offload_dir` to dispatch this model according to this `device_map`, the following submodules need to be offloaded: base_model.model.model.layers.3, base_model.model.model.layers.4, base_model.model.model.layers.5, base_model.model.model.layers.6, base_model.model.model.layers.7, base_model.model.model.layers.8, base_model.model.model.layers.9, base_model.model.model.layers.10, base_model.model.model.la
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpaca-lora.