Almaatla commited on
Commit
da7d888
·
verified ·
1 Parent(s): 0ad3093

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -15,8 +15,11 @@ import secrets
15
  import time
16
  import requests
17
  import tempfile
 
 
18
 
19
  from groq import Groq
 
20
 
21
  tokenizer = tiktoken.encoding_for_model("gpt-3.5-turbo")
22
 
@@ -35,7 +38,9 @@ text_splitter = RecursiveCharacterTextSplitter(
35
  separators=["\n\n", "\n", " ", ""]
36
  )
37
 
38
- embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
 
 
39
  foo = Document(page_content='foo is fou!',metadata={"source":'foo source'})
40
 
41
 
 
15
  import time
16
  import requests
17
  import tempfile
18
+ import spaces
19
+
20
 
21
  from groq import Groq
22
+ from sentence_transformers import SentenceTransformer
23
 
24
  tokenizer = tiktoken.encoding_for_model("gpt-3.5-turbo")
25
 
 
38
  separators=["\n\n", "\n", " ", ""]
39
  )
40
 
41
+ #embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
42
+ embeddings = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2',device="cuda")
43
+
44
  foo = Document(page_content='foo is fou!',metadata={"source":'foo source'})
45
 
46