Skip to content

Commit

Permalink
deploy: d46a858
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondWang0 committed Apr 18, 2024
1 parent c987605 commit c248121
Showing 1 changed file with 63 additions and 55 deletions.
118 changes: 63 additions & 55 deletions model_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>};</div>
</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="keyword">enum</span> { OPT_125M, OPT_1_3B, OPT_6_7B, LLaMA_7B, LLaMA_13B, CodeLLaMA_7B, CodeLLaMA_13B, StarCoder_15_5B, LLaVA_7B, LLaVA_13B, VILA_7B, VILA_13B, Clip_ViT_Large };</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="keyword">enum</span> { OPT_125M, OPT_1_3B, OPT_6_7B, LLaMA_7B, LLaMA_13B, CodeLLaMA_7B, CodeLLaMA_13B, StarCoder_15_5B, LLaVA_7B, LLaVA_13B, VILA_2_7B, VILA_7B, VILA_13B, Clip_ViT_Large, Mistral_7B};</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="keyword">enum</span> { FP32, QINT8, INT4 };</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> opt_6_7B(1, 32, 32, 2048, 4096, 16384, 50272, 1, 0);</div>
Expand All @@ -148,60 +148,68 @@
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> starcoder_15_5B(1, 48, 40, 2048, 6144, 24576, 49152, 1, 0);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> llava_7B(1, 32, 32, 2048, 4096, 11008, 32000, 1, 1e-5);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> llava_13B(1, 40, 40, 2048, 5120, 13824, 32000, 1, 1e-5);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> vila_7B(1, 32, 32, 2048, 4096, 11008, 32000, 1, 1e-5);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> vila_13B(1, 40, 40, 2048, 5120, 13824, 32000, 1, 1e-5);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> clip_vit_large(1, 16, 23, 2048, 1024, 4096, 0, 1, 0, 336, 14, 768, 4096); <span class="comment">// llava&#39;s and vila&#39;s clip model uses only 23 layers out of 24</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="keyword">static</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> get_opt_model_config(int choise) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> ret;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">switch</span> (choise) {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">case</span> OPT_125M:</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> ret = opt_125m;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">case</span> OPT_1_3B:</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> ret = opt_1_3B;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">case</span> OPT_6_7B:</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> ret = opt_6_7B;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">case</span> LLaMA_7B:</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> ret = llama_7B;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">case</span> LLaMA_13B:</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> ret = llama_13B;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">case</span> CodeLLaMA_7B:</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> ret = codellama_7B;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">case</span> CodeLLaMA_13B:</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> ret = codellama_13B;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">case</span> StarCoder_15_5B:</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> ret = starcoder_15_5B;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">case</span> LLaVA_7B:</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> ret = llava_7B;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordflow">case</span> LLaVA_13B:</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> ret = llava_13B;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">case</span> VILA_7B:</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> ret = vila_7B;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">case</span> VILA_13B:</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> ret = vila_13B;</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">case</span> Clip_ViT_Large:</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> ret = clip_vit_large;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">default</span>:</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Unsupported model choice.&quot;</span>);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>}</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> vila_2_7B(1, 20, 32, 2048, 2560, 6912, 32000, 1, 1e-5);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> vila_7B(1, 32, 32, 2048, 4096, 11008, 32000, 1, 1e-5);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> vila_13B(1, 40, 40, 2048, 5120, 13824, 32000, 1, 1e-5);</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> clip_vit_large(1, 16, 23, 2048, 1024, 4096, 0, 1, 0, 336, 14, 768, 4096); <span class="comment">// llava&#39;s and vila&#39;s clip model uses only 23 layers out of 24</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="keyword">const</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> mistral_7B(1, 32, 32, 2048, 4096, 11008, 32000, 1, 1e-6);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="keyword">static</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> get_opt_model_config(int choise) {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">struct </span><a class="code hl_struct" href="structmodel__config.html">model_config</a> ret;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">switch</span> (choise) {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">case</span> OPT_125M:</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> ret = opt_125m;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">case</span> OPT_1_3B:</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> ret = opt_1_3B;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">case</span> OPT_6_7B:</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> ret = opt_6_7B;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">case</span> LLaMA_7B:</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> ret = llama_7B;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">case</span> LLaMA_13B:</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> ret = llama_13B;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">case</span> CodeLLaMA_7B:</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> ret = codellama_7B;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">case</span> CodeLLaMA_13B:</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> ret = codellama_13B;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">case</span> StarCoder_15_5B:</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> ret = starcoder_15_5B;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">case</span> LLaVA_7B:</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> ret = llava_7B;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">case</span> LLaVA_13B:</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> ret = llava_13B;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">case</span> VILA_2_7B:</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> ret = vila_2_7B;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">case</span> VILA_7B:</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> ret = vila_7B;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">case</span> VILA_13B:</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> ret = vila_13B;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">case</span> Clip_ViT_Large:</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> ret = clip_vit_large;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">case</span> Mistral_7B:</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> ret = mistral_7B;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">default</span>:</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Unsupported model choice.&quot;</span>);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>}</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="astructmodel__config_html"><div class="ttname"><a href="structmodel__config.html">model_config</a></div><div class="ttdef"><b>Definition</b> model.h:5</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
Expand Down

0 comments on commit c248121

Please sign in to comment.