Comments (7)
in localGPT/run_localGPT.py
-
Add
import torch
andfrom transformers import AutoTokenizer, AutoModelForCausalLM
at the beginning -
In
load_model()
function, changeLlamaTokenizer
toAutoTokenizer
-
Change
LlamaForCausalLM
toAutoModelForCausalLM
-
Add the following options to
AutoModelForCausalLM.from_pretrained()
function call:device_map='auto'
torch_dtype=torch.float16
Tested on model TheBloke/Wizard-Vicuna-13B-Uncensored-HF ยท Hugging Face
from localgpt.
I'm also interested in this. I can't get it on the GPU for some reason.
from localgpt.
will test it later this day, i take you guys updated !
from localgpt.
would you mind to post the functions.
I try to do that and it returns error, with me...
from localgpt.
This is what I ended up doing
gpu = True
def load_model():
model_id = "TheBloke/vicuna-7B-1.1-HF"
# model_id = "mayaeary/pygmalion-6b_dev-4bit-128g"
# model_id = "TheBloke/wizardLM-7B-GPTQ"
if gpu:
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id,
device_map='auto',
torch_dtype=torch.float16,
)
else:
tokenizer = LlamaTokenizer.from_pretrained(model_id)
model = LlamaForCausalLM.from_pretrained(model_id)
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_length=2048,
temperature=0,
top_p=0.95,
repetition_penalty=1.15
)
local_llm = HuggingFacePipeline(pipeline=pipe)
return local_llm
You will probably need a 24GB GPU to run that model though
from localgpt.
I solved similar/same issue by reinstalling torch:
pip install torch --index-url https://download.pytorch.org/whl/cu118 --upgrade --force-reinstall
Source: adapted from https://stackoverflow.com/a/76144354/885761
from localgpt.
Non of these solutions work for me, it still running on cpu. :(
Edit: sorry i was a noob, the model i ran doesnt work on gpu. So i changed it to a different model and now my gpu is running at 100% from both anaconda and wsl2.
from localgpt.
Related Issues (20)
- How to show document sources as images instead of text in the streamlit dashboard? HOT 1
- Error in running this run_localGPT.py HOT 4
- 500 Internal Server Error HOT 2
- SSL issues HOT 1
- /lib64/libgcc_s.so.1: version `GCC_7.0.0' not found libarrow.so.1400 HOT 1
- Phi-2 support HOT 1
- Terminal VS Interface GPU problem HOT 5
- IndexError: list index out of range HOT 2
- AutoGPTQ must be updated to 0.6 for Mistral HOT 2
- Compare the response time differences between 4xA100 and 8xH100 HOT 5
- Type=Value Error whenever we load any other LLM model rather than Llama and Mistral HOT 1
- PowerInfer integration
- Embdedings & Model files Location in local system. HOT 4
- Local Gpt
- Requested tokens exceed context window of 4096 HOT 3
- KeyError: 'Cache only has 0 layers, attempted to access layer with index 0' HOT 3
- Suggestion to improve or fine tune the model with custom documents HOT 1
- No module named click HOT 1
- run_localGPT.py fail: python run_localGPT.py --device_type cpu
- multi-user or async prompt requests crashes the app HOT 6
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 localgpt.