diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..872fe36 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/02.ChatWithGemma7b /gemmachat.py b/02.ChatWithGemma7b /gemmachat.py index 2a1bb3c..a01651a 100644 --- a/02.ChatWithGemma7b /gemmachat.py +++ b/02.ChatWithGemma7b /gemmachat.py @@ -1,11 +1,10 @@ -# pip install accelerate from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("google/gemma-7b-it") -model = AutoModelForCausalLM.from_pretrained("google/gemma-7b-it", device_map="auto") +model = AutoModelForCausalLM.from_pretrained("google/gemma-7b-it") input_text = "Write me a poem about Machine Learning." -input_ids = tokenizer(input_text, return_tensors="pt").to("cuda") +input_ids = tokenizer(input_text, return_tensors="pt") outputs = model.generate(**input_ids) print(tokenizer.decode(outputs[0])) diff --git a/README.md b/README.md index 7a71ad9..b61bd6b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # FlyPythonLLM -Code of FlyPython Newsletter + +Code of [FlyPython Newsletter](https://blog.flypython.com/) + + +## free content +1. GPTChat +2. ChatWithGemma7b +3. GPTs Action (1) +4. GPTs Action (2) +5. LangChain(1) +6. LangChain(2) + + + + +## paid content +1. MoneyPrinter +2. mindgraph +3. metavoice \ No newline at end of file