atlascypher commited on
Commit
7a16c26
·
verified ·
1 Parent(s): edbec73

Inserted Medication List csv as dataset

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -5,12 +5,12 @@ from huggingface_hub import InferenceClient
5
  from datasets import load_dataset
6
  from sentence_transformers import SentenceTransformer
7
  import torch
8
- import pandas
9
 
10
- file_path = '_MConverter_eu_drugs_for_common_treatments.txt'
11
- dataset = load_dataset("text", data_files="_MConverter_eu_drugs_for_common_treatments.txt")
12
 
13
- with open("_MConverter_eu_drugs_for_common_treatments.txt", "r", encoding = "utf-8") as file:
14
  file_path = file.read()
15
  # print(file_path)
16
 
@@ -26,8 +26,8 @@ for chunked in chunked_list: #loops through database & adds it to the modificati
26
  if stripped_list:
27
  cleaned_chunks.append(stripped_list) # appends to empty in cleaned_chunks = []
28
  #print(cleaned_chunks)
29
-
30
-
31
 
32
  def respond(message, history):
33
  if not history:
 
5
  from datasets import load_dataset
6
  from sentence_transformers import SentenceTransformer
7
  import torch
8
+ import pandas as pd
9
 
10
+ file_path = "drug list for ai medication chatbot - Sheet1"
11
+ dataset = load_dataset("csv", data_files="drug list for ai medication chatbot - Sheet1.csv")
12
 
13
+ with open("drug list for ai medication chatbot - Sheet1.csv", "r", encoding = "utf-8") as file:
14
  file_path = file.read()
15
  # print(file_path)
16
 
 
26
  if stripped_list:
27
  cleaned_chunks.append(stripped_list) # appends to empty in cleaned_chunks = []
28
  #print(cleaned_chunks)
29
+ df = pd.read_csv("drug list for ai medication chatbot - Sheet1.csv")
30
+ print(df)
31
 
32
  def respond(message, history):
33
  if not history: