Spaces:
Build error
Build error
SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files16 unmodified lines1718192020212223242425262729 unmodified lines575859606016 unmodified lines low_cpu_mem_usage=True # Enable low memory usage on CPU ) # Move model to CPU # Use 'auto' or 'balanced' device_map for CPU or GPU model = load_checkpoint_and_dispatch( model, MODEL_NAME, device_map="cpu", # Load model onto CPU device_map="auto", # Automatically determine the best device allocation ) return pipeline("text-generation", model=model, tokenizer=tokenizer)29 unmodified lines else: st.warning("Please enter a prompt.")
st.caption("Created by Shamil")st.caption("Powered by CodeGen-2B | Streamlit UI | CPU Optimized")app.py+3-3