jzhang533 commited on
Commit
1405f2a
·
1 Parent(s): 7335512

use Qwen/Qwen2-0.5B-Instruct

Browse files

Signed-off-by: Zhang Jun <[email protected]>

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
  from paddlenlp.transformers import AutoTokenizer, AutoModelForCausalLM
3
 
4
- tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-0.5B")
5
- model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B", dtype="float32")
6
 
7
 
8
  def inference(input_text):
@@ -20,7 +20,7 @@ title = 'PaddlePaddle Meets LLM'
20
  description = '''
21
  - The underlying execution framework is based on [PaddlePaddle](https://github.com/PaddlePaddle/Paddle) and [PaddleNLP](https://github.com/PaddlePaddle/PaddleNLP).
22
  - PaddleNLP supports a wide range of open-source LLMs. Check out the [full model list](https://github.com/PaddlePaddle/PaddleNLP?tab=readme-ov-file#%E6%A8%A1%E5%9E%8B%E6%94%AF%E6%8C%81).
23
- - We chose QWEN2-0.5B as the model for this use case due to limited computational resources.
24
  - [ERNIE 4.5](https://yiyan.baidu.com/) was trained with PaddlePaddle, [give it a try](https://huggingface.co/spaces/PaddlePaddle/ernie_demo)!
25
  '''
26
 
 
1
  import gradio as gr
2
  from paddlenlp.transformers import AutoTokenizer, AutoModelForCausalLM
3
 
4
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-0.5B-Instruct")
5
+ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B-Instruct", dtype="float32")
6
 
7
 
8
  def inference(input_text):
 
20
  description = '''
21
  - The underlying execution framework is based on [PaddlePaddle](https://github.com/PaddlePaddle/Paddle) and [PaddleNLP](https://github.com/PaddlePaddle/PaddleNLP).
22
  - PaddleNLP supports a wide range of open-source LLMs. Check out the [full model list](https://github.com/PaddlePaddle/PaddleNLP?tab=readme-ov-file#%E6%A8%A1%E5%9E%8B%E6%94%AF%E6%8C%81).
23
+ - We chose QWEN2-0.5B-Instruct as the model for this use case due to limited computational resources.
24
  - [ERNIE 4.5](https://yiyan.baidu.com/) was trained with PaddlePaddle, [give it a try](https://huggingface.co/spaces/PaddlePaddle/ernie_demo)!
25
  '''
26