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, ...
Being rusty, I did hands.extend( (b_hand + [card] for card in joker_cards('red'))) And, of course, I actually meant a list comprehension. I actually made myself look better here - I had first done list.append - which gave me a list of lists of lists, rather than a list of lists, which was what I wanted.. if it worked - which it didn't of course - giving me a generator expression. chatGPT told me to wrap the generator expression in list(), which I did - not thinking clearly.. All I needed was: hands.extend( [b_hand + [card] for card in joker_cards('red')] ) Which leads us to the question of generator expressions - what? why? Where?.. What A way to create generators (type of iterable you can use to create lazy sequences) without having to define a function A Genertor function allows you to declare a function that behaves like an iterator - now you can loop around this function call Example (expression for item in ite...