Kohaku-Blueleaf commited on
Commit
dc6d4cb
1 Parent(s): f47341f

Use transformers library

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -110,14 +110,9 @@ masterpiece, newest, absurdres, {rating}"""
110
 
111
 
112
  if __name__ == "__main__":
113
- repo = Repository(
114
- local_dir="./model", clone_from="https://huggingface.co/KBlueLeaf/DanTagGen"
115
- )
116
- text_model = Llama(
117
- "./model/ggml-model-Q6_K.gguf",
118
- n_ctx=384,
119
- verbose=False,
120
- )
121
 
122
  def wrapper(
123
  rating: str,
@@ -135,7 +130,7 @@ if __name__ == "__main__":
135
  ):
136
  yield from get_result(
137
  text_model,
138
- None,
139
  rating,
140
  artist,
141
  characters,
 
110
 
111
 
112
  if __name__ == "__main__":
113
+ tokenizer = LlamaTokenizer.from_pretrained(MODEL_PATH)
114
+ text_model = LlamaForCausalLM.from_pretrained(MODEL_PATH)
115
+ text_model = text_model.eval()
 
 
 
 
 
116
 
117
  def wrapper(
118
  rating: str,
 
130
  ):
131
  yield from get_result(
132
  text_model,
133
+ tokenizer,
134
  rating,
135
  artist,
136
  characters,