Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import pandas as pd | |
| import os | |
| import docx2txt | |
| #from docx import Document | |
| #from datasets import load_dataset | |
| #dataset = load_dataset("text", data_files="C:/Users/Rhodri Smith/OneDrive - Cardiff University/Desktop/ChatBot/Contamination_Monitoring/CONTAMINATION.docx") | |
| # read in word file | |
| #result = docx2txt.process(r"C:\Users\Rhodri Smith\Desktop\Contamination_Monitoring\CONTAMINATION.docx") | |
| #dir_path = 'C:/Users/Rhodri Smith/OneDrive - Cardiff University/Desktop/ChatBot/Contamination_Monitoring/' | |
| #Create a document object | |
| #doc = Document() | |
| #Loop through the directory and print the list of files | |
| #for file in os.listdir(dir_path): | |
| # print(file) | |
| #doc.add_paragraph(file) | |
| # Read the document | |
| #for para in document.paragraphs: | |
| # print(para.text) | |
| def greet(name): | |
| return "Hello " + name + "!" | |
| demo = gr.Interface( | |
| fn=greet, | |
| inputs=gr.Textbox(lines=2, placeholder="Name Here..."), | |
| outputs="text", | |
| ) | |
| demo.launch() | |