Spaces:
Runtime error
Runtime error
Royrotem100
commited on
Commit
•
6a758ff
1
Parent(s):
b7358fc
Add DictaLM 2.0 instruct model
Browse files- app.py +9 -3
- dictalm2.0-instruct → dictalm2.0-instruct-roys +0 -0
- dictalm2.0-instruct-roys-chat +1 -0
- requirements.txt +2 -1
app.py
CHANGED
@@ -7,11 +7,17 @@ from flask import Flask, request, jsonify
|
|
7 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
8 |
import threading
|
9 |
import requests
|
|
|
10 |
|
11 |
|
12 |
# Load the model and tokenizer
|
13 |
-
tokenizer = AutoTokenizer.from_pretrained("./dictalm2.0-instruct")
|
14 |
-
model = AutoModelForCausalLM.from_pretrained("./dictalm2.0-instruct")
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
History = List[Tuple[str, str]]
|
17 |
Messages = List[Dict[str, str]]
|
@@ -123,7 +129,7 @@ with gr.Blocks(css='''
|
|
123 |
textarea {
|
124 |
font-size: 1.2em;
|
125 |
}
|
126 |
-
''', js=
|
127 |
gr.Markdown("""
|
128 |
<div class="dicta-header">
|
129 |
<a href="">
|
|
|
7 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
8 |
import threading
|
9 |
import requests
|
10 |
+
import torch
|
11 |
|
12 |
|
13 |
# Load the model and tokenizer
|
14 |
+
#tokenizer = AutoTokenizer.from_pretrained("./dictalm2.0-instruct-roys-chat")
|
15 |
+
#model = AutoModelForCausalLM.from_pretrained("./dictalm2.0-instruct-roys-chat")
|
16 |
+
|
17 |
+
# Load the model and tokenizer
|
18 |
+
model_name = "dicta-il/dictalm2.0-instruct"
|
19 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
21 |
|
22 |
History = List[Tuple[str, str]]
|
23 |
Messages = List[Dict[str, str]]
|
|
|
129 |
textarea {
|
130 |
font-size: 1.2em;
|
131 |
}
|
132 |
+
''', js=None) as demo:
|
133 |
gr.Markdown("""
|
134 |
<div class="dicta-header">
|
135 |
<a href="">
|
dictalm2.0-instruct → dictalm2.0-instruct-roys
RENAMED
File without changes
|
dictalm2.0-instruct-roys-chat
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 904fe27fa1d32569b62b4a0fc094e3277bd076d3
|
requirements.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
flask
|
2 |
gradio
|
3 |
transformers
|
4 |
-
torch
|
|
|
|
1 |
flask
|
2 |
gradio
|
3 |
transformers
|
4 |
+
torch
|
5 |
+
requests
|