Spaces:
Runtime error
Runtime error
Commit
·
01f2f78
1
Parent(s):
327d5b5
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,13 +19,13 @@ def create_spark_dataframe(text):
|
|
| 19 |
return df
|
| 20 |
|
| 21 |
# Read the "War and Peace" text file and create Spark DataFrame
|
| 22 |
-
with open('
|
| 23 |
text = file.read()
|
| 24 |
df_chapters = create_spark_dataframe(text)
|
| 25 |
|
| 26 |
# Define the Llama models
|
| 27 |
-
MODEL_Q8_0 = Llama(model_path="
|
| 28 |
-
MODEL_Q2_K = Llama(model_path="
|
| 29 |
|
| 30 |
# Function to summarize a chapter using the selected model
|
| 31 |
def llama2_summarize(chapter_text, model_version):
|
|
|
|
| 19 |
return df
|
| 20 |
|
| 21 |
# Read the "War and Peace" text file and create Spark DataFrame
|
| 22 |
+
with open('war_and_peace.txt', 'r') as file:
|
| 23 |
text = file.read()
|
| 24 |
df_chapters = create_spark_dataframe(text)
|
| 25 |
|
| 26 |
# Define the Llama models
|
| 27 |
+
MODEL_Q8_0 = Llama(model_path="llama-2-7b-chat.ggmlv3.q8_0.bin", n_ctx=8192, n_batch=512)
|
| 28 |
+
MODEL_Q2_K = Llama(model_path="llama-2-7b-chat.ggmlv3.q2_K.bin", n_ctx=8192, n_batch=512)
|
| 29 |
|
| 30 |
# Function to summarize a chapter using the selected model
|
| 31 |
def llama2_summarize(chapter_text, model_version):
|