Update app.py
Browse files
app.py
CHANGED
@@ -63,17 +63,16 @@ def bot(
|
|
63 |
"Please follow the instructions in the README to set it up.")
|
64 |
|
65 |
if file_prompt is not None:
|
66 |
-
# Initialize an empty
|
67 |
-
|
68 |
for file in file_prompt:
|
69 |
# Open the file in read binary mode ('rb')
|
70 |
with open(file.name, 'rb') as f:
|
71 |
# Read the entire file content into a byte string
|
72 |
content = f.read()
|
73 |
# Decode the byte string to a UTF-8 string (assuming text file)
|
74 |
-
|
75 |
-
|
76 |
-
text_prompt = chatbot[-1][0]
|
77 |
genai.configure(api_key=google_key)
|
78 |
generation_config = genai.types.GenerationConfig(
|
79 |
temperature=temperature,
|
|
|
63 |
"Please follow the instructions in the README to set it up.")
|
64 |
|
65 |
if file_prompt is not None:
|
66 |
+
# Initialize an empty string to store content
|
67 |
+
all_content = ""
|
68 |
for file in file_prompt:
|
69 |
# Open the file in read binary mode ('rb')
|
70 |
with open(file.name, 'rb') as f:
|
71 |
# Read the entire file content into a byte string
|
72 |
content = f.read()
|
73 |
# Decode the byte string to a UTF-8 string (assuming text file)
|
74 |
+
all_content += content.decode('utf-8')
|
75 |
+
text_prompt = all_content + " " + chatbot[-1][0]
|
|
|
76 |
genai.configure(api_key=google_key)
|
77 |
generation_config = genai.types.GenerationConfig(
|
78 |
temperature=temperature,
|