Spaces:
Build error
Build error
Download search/valid_med.py from vikaso001/phi2-rag-api: direct link, hf CLI and curl.
- Browser
- Download file 827 Bytes
-
https://huggingface.co/spaces/vikaso001/phi2-rag-api/resolve/main/search/valid_med.py
- Command line
-
hf download hf://spaces/vikaso001/phi2-rag-api/search/valid_med.py
-
curl -L -o valid_med.py https://huggingface.co/spaces/vikaso001/phi2-rag-api/resolve/main/search/valid_med.py
827 Bytes
| # import pandas as pd | |
| # # Load the dataset (adjust the filename if needed) | |
| # mid_df = pd.read_excel('./search/MID.xlsx') | |
| # # Extract and clean medicine names | |
| # valid_med_names = ( | |
| # mid_df['NAME'] | |
| # .dropna() | |
| # .str.strip() | |
| # .str.lower() | |
| # .unique() | |
| # .tolist() | |
| # ) | |
| # # Save to a text file | |
| # with open('valid_med_names.txt', 'w', encoding='utf-8') as f: | |
| # for name in valid_med_names: | |
| # f.write(f"{name}\n") | |
| # print(f"Saved {len(valid_med_names)} unique medicine names to valid_med_names.txt") | |
| import pandas as pd | |
| # Load the Excel file (specify the sheet name if needed) | |
| df = pd.read_excel("search/MID.xlsx") # or pd.read_excel("your_file.xlsx", sheet_name="Sheet1") | |
| # Get the column headers | |
| headings = df.columns.tolist() | |
| print("Headings:", headings) | |