tuandunghcmut commited on
Commit
eb15267
·
1 Parent(s): 095b16a
Files changed (1) hide show
  1. models.py +53 -0
models.py CHANGED
@@ -15,6 +15,18 @@ RECOMMENDED_MODELS = {
15
  "description": "3B parameter vision-language model with instruction tuning",
16
  "dtype": "bfloat16",
17
  "device": "cuda"
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
  }
20
 
@@ -32,6 +44,47 @@ DEFAULT_GENERATION_PARAMS = {
32
  "no_repeat_ngram_size": 0
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  def get_model_info(model_name):
36
  """
37
  Returns the model information for a given model name.
 
15
  "description": "3B parameter vision-language model with instruction tuning",
16
  "dtype": "bfloat16",
17
  "device": "cuda"
18
+ },
19
+ "Qwen2-VL-7B": {
20
+ "id": "Qwen/Qwen2-VL-7B",
21
+ "description": "7B parameter vision-language model (Qwen2 series)",
22
+ "dtype": "bfloat16",
23
+ "device": "cuda"
24
+ },
25
+ "Qwen2-VL-7B-Instruct": {
26
+ "id": "Qwen/Qwen2-VL-7B-Instruct",
27
+ "description": "7B parameter vision-language model with instruction tuning (Qwen2 series)",
28
+ "dtype": "bfloat16",
29
+ "device": "cuda"
30
  }
31
  }
32
 
 
44
  "no_repeat_ngram_size": 0
45
  }
46
 
47
+ # Generation parameter presets for quick selection
48
+ GENERATION_PRESETS = {
49
+ "Default": DEFAULT_GENERATION_PARAMS,
50
+ "Creative": {
51
+ "max_new_tokens": 1024,
52
+ "temperature": 0.9,
53
+ "top_p": 0.95,
54
+ "top_k": 60,
55
+ "repetition_penalty": 1.1,
56
+ "do_sample": True,
57
+ "num_beams": 1,
58
+ "early_stopping": True,
59
+ "length_penalty": 1.0,
60
+ "no_repeat_ngram_size": 0
61
+ },
62
+ "Precise": {
63
+ "max_new_tokens": 1024,
64
+ "temperature": 0.5,
65
+ "top_p": 0.85,
66
+ "top_k": 40,
67
+ "repetition_penalty": 1.2,
68
+ "do_sample": True,
69
+ "num_beams": 3,
70
+ "early_stopping": True,
71
+ "length_penalty": 1.0,
72
+ "no_repeat_ngram_size": 3
73
+ },
74
+ "Deterministic": {
75
+ "max_new_tokens": 1024,
76
+ "temperature": 0.0,
77
+ "top_p": 1.0,
78
+ "top_k": 50,
79
+ "repetition_penalty": 1.0,
80
+ "do_sample": False,
81
+ "num_beams": 5,
82
+ "early_stopping": True,
83
+ "length_penalty": 1.0,
84
+ "no_repeat_ngram_size": 0
85
+ }
86
+ }
87
+
88
  def get_model_info(model_name):
89
  """
90
  Returns the model information for a given model name.