User trying to import a module that's not installed. Instead of bumping him and telling her to use a different workspace on which the module *is* installed, use compute resources to try and install.. nuts.. Starting with : from transformers import TFAutoModelForSeq2SeqLM, AutoTokenizer import gradio as gr model = TFAutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small") tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small") def gen_text(input_string, max_length): inputs = tokenizer(input_string, return_tensors="pt") outputs = model.generate(**inputs, max_length=max_length) final_text = tokenizer.batch_decode(outputs[0], skip_special_tokens=True) return (final_text) demo = gr.Interface( fn=gen_text, ...
The problem - Udacity likes to uses only spaces, not tabs for indentation.
In NEdit, starting decades ago, you've set it to use tabs or emulated tabs.. Whatever, when you start with code from Udacity and then try running a hacked version in your local python installation, you get "Inconsistent use of Tabs and spaces".
Answer? New macro in NEdit - ALT-T that can replace tabs with four spaces in a selection. Just put this in the nedit.macroCommands: section in your ~/.nedit/nedit.rc file
tab_2_spc:Alt+T::: {\n\
filter_selection("perl -p -e 's/\\\\t/ /g;'")\n\
}\n
Comments
Post a Comment