tamas.kiss commited on
Commit
8845dcb
1 Parent(s): 5a1d695

Update logs

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -268,10 +268,12 @@ def text_to_text_generation(verbose, prompt):
268
  match response_num:
269
  case 0:
270
  prompt = f"[INST] {prompt}\n Lets think step by step. [/INST] {start_template}"
 
271
  print(prompt)
272
  case 1:
273
  if retriever == "semantic_search":
274
  question = prompt
 
275
  print(
276
  (
277
  f"You are a helpful kubernetes professional. [INST] Use the following documentation, if it is relevant to answer the question below. [/INST]\nDocumentation: [RETRIEVED_RESULTS_FROM_BOOK] [INST] Answer the following question: {question} [/INST]\nAnswer: \n")
@@ -292,7 +294,8 @@ def text_to_text_generation(verbose, prompt):
292
  retrieved_results = google_search(prompt)
293
  question = prompt
294
  prompt = f"You are a helpful kubernetes professional. [INST] Use the following documentation, if it is relevant to answer the question below. [/INST]\nDocumentation: {retrieved_results} </s>\n<s> [INST] Answer the following question: {prompt} [/INST]\nAnswer: "
295
-
 
296
  print(
297
  (
298
  f"You are a helpful kubernetes professional. [INST] Use the following documentation, if it is relevant to answer the question below. [/INST]\nDocumentation: [RETRIEVED_RESULTS_FROM_GOOGLE] [INST] Answer the following question: {question} [/INST]\nAnswer: \n"
@@ -309,10 +312,12 @@ def text_to_text_generation(verbose, prompt):
309
  )
310
  else:
311
  prompt = f"[INST] Answer the following question: {prompt} [/INST]\nAnswer: "
 
312
  print(prompt)
313
 
314
  case _:
315
  prompt = f"[INST] {prompt} [/INST]"
 
316
  print(prompt)
317
 
318
  return prompt, md
@@ -343,7 +348,7 @@ def text_to_text_generation(verbose, prompt):
343
 
344
  return (prompt, answer[start:end].strip())
345
 
346
- modes = ["Kubectl command", "Kubernetes related definition", "Other"]
347
 
348
  print(f'{" Query Start ":-^40}')
349
  print("Classified as: " + modes[response_num])
 
268
  match response_num:
269
  case 0:
270
  prompt = f"[INST] {prompt}\n Lets think step by step. [/INST] {start_template}"
271
+ print('Kubectl command prompt:')
272
  print(prompt)
273
  case 1:
274
  if retriever == "semantic_search":
275
  question = prompt
276
+ print('Semantic search prompt:')
277
  print(
278
  (
279
  f"You are a helpful kubernetes professional. [INST] Use the following documentation, if it is relevant to answer the question below. [/INST]\nDocumentation: [RETRIEVED_RESULTS_FROM_BOOK] [INST] Answer the following question: {question} [/INST]\nAnswer: \n")
 
294
  retrieved_results = google_search(prompt)
295
  question = prompt
296
  prompt = f"You are a helpful kubernetes professional. [INST] Use the following documentation, if it is relevant to answer the question below. [/INST]\nDocumentation: {retrieved_results} </s>\n<s> [INST] Answer the following question: {prompt} [/INST]\nAnswer: "
297
+
298
+ print('Google search prompt:')
299
  print(
300
  (
301
  f"You are a helpful kubernetes professional. [INST] Use the following documentation, if it is relevant to answer the question below. [/INST]\nDocumentation: [RETRIEVED_RESULTS_FROM_GOOGLE] [INST] Answer the following question: {question} [/INST]\nAnswer: \n"
 
312
  )
313
  else:
314
  prompt = f"[INST] Answer the following question: {prompt} [/INST]\nAnswer: "
315
+ print('No retriever question prompt:')
316
  print(prompt)
317
 
318
  case _:
319
  prompt = f"[INST] {prompt} [/INST]"
320
+ print('Other question prompt:')
321
  print(prompt)
322
 
323
  return prompt, md
 
348
 
349
  return (prompt, answer[start:end].strip())
350
 
351
+ modes = ["Kubectl command", "Kubernetes related", "Other"]
352
 
353
  print(f'{" Query Start ":-^40}')
354
  print("Classified as: " + modes[response_num])