Spaces:
Sleeping
Sleeping
added text streamer
Browse files- backend.py +3 -3
- interface.py +0 -2
backend.py
CHANGED
@@ -43,11 +43,11 @@ parser = SentenceSplitter.from_defaults(
|
|
43 |
|
44 |
def build_index():
|
45 |
# Load documents from a file
|
46 |
-
documents = SimpleDirectoryReader(input_files=["data/blockchainprova.txt"]).load_data()
|
47 |
# Parse the documents into nodes
|
48 |
-
nodes = parser.get_nodes_from_documents(documents)
|
49 |
# Build the vector store index from the nodes
|
50 |
-
index = VectorStoreIndex(nodes)
|
51 |
|
52 |
return index
|
53 |
|
|
|
43 |
|
44 |
def build_index():
|
45 |
# Load documents from a file
|
46 |
+
documents = SimpleDirectoryReader(input_files=["data/blockchainprova.txt"]).load_data()
|
47 |
# Parse the documents into nodes
|
48 |
+
nodes = parser.get_nodes_from_documents(documents)
|
49 |
# Build the vector store index from the nodes
|
50 |
+
index = VectorStoreIndex(nodes)
|
51 |
|
52 |
return index
|
53 |
|
interface.py
CHANGED
@@ -7,8 +7,6 @@ from transformers import TextIteratorStreamer
|
|
7 |
from threading import Thread
|
8 |
|
9 |
|
10 |
-
|
11 |
-
|
12 |
class GemmaLLMInterface(CustomLLM):
|
13 |
model: Any
|
14 |
tokenizer: Any
|
|
|
7 |
from threading import Thread
|
8 |
|
9 |
|
|
|
|
|
10 |
class GemmaLLMInterface(CustomLLM):
|
11 |
model: Any
|
12 |
tokenizer: Any
|