import gradio as gr from transformers import pipeline pipe = pipeline("question-answering", model="deepset/roberta-large-squad2") def get_answer(input_text): context = '''Sun Ultra hardware and Solaris operating system technology are used to support all client server modules including human machine interface (HMI) and application clients. HMI client modules are also available on Intel systems running the Microsoft Windows operating system. The operational environment gives a common look and feel on all operating systems, combined with an “operate from anywhere” network connectivity to the SCADA database. SCADA system components are arranged redundantly to support very high availability platforms. Redundant components may include:Human Machine Interface (HMI),Front-End Processor (FEP),Database,Calculations,History,Communications,Networks and workstations. State-of-the-art, real-time object distribution and management provide object level redundancy and load sharing in the Master Station. The Human Machine Interface (HMI) subsystem provides the operator interface and the visualization tools of the system via single or multiple monitor displays. This subsystem also manages system lists, report generation and printing, and logging services. The “operate from anywhere” architecture supports remote modem access by Windows (Intel based) operator stations. Each remote station has the same HMI functions as those of the SCADA Master Station. A typical HMI console consists of one or more screens that provide a windowing environment accessible by a single keyboard and mouse.The HMI provides the following main facilities at the operator console. Data Visualization :The operator is able to visualize data from a wide range of graphic displays. Complexity can be managed by the use of:Layering,Panning,Zooming,Decluttering. Display Navigation :The operator is able to navigate to/from each graphic using:Display selection from dynamic objects, Control and display access from any point value,Built-in navigational links between displays. Data and Control Presentation Supervisory control is managed directly from the observed display by presentation of all relevant information. This provides: Positive control reserve indication,Two-step control actions,Associated point value and quality status display,System lists (dynamically updated),Operator controllable system list filtering/scrolling,Control interlocking, System monitoring, Detection of islanding conditions. The Front End Processor (FEP) is the telemetry manager of the system. It comprises software and hardware components.The FEP manages and controls multiple communication lines for:Line health,Line loading,Line fail over.Line error statistics are calculated and are available for diagnostic and operational review.Line fail over can be manually controlled or automatically initiated by the setting of adjustable communication line failure parameters. “Check before execute” output commands and field time synchronization are coordinated by the FEP using standard protocol facilities. The FEP has the capability to manage a number of different physical communications interfaces. The optional Communications Line Server (CLS), an Invensys Process Systems device tightly integrated with the FEP software, provides features not available in commercial terminal servers. These include: Redundant LAN connections,Physical line fail over switching,Isochronous protocols,Direct GPS interface, High accuracy (millisecond) time synchronization of Remote Terminal Units (RTUs),Integrated V.23/Bell 202 modems,Industrial hardened technology. Refer to PSS 21H-8D2 B4 for further CLS details. Standard terminal servers may be redundantly configured for multiple RS-232 telemetry connections. The integral RS-232 ports of the FEP servers may also be used. The FEP can scan RTUs using SCADA protocols over TCP/IP (for example, DNP over TCP/IP). SCADA protocols are integrated to retrieve data and issue controls to remote devices. Invensys Process Systems track and contribute to a variety of open protocol user groups and committees. The open protocols implemented include:,DNP3,IEC 60870-5-101,IEC 60870-5-104. Core SCADA provides the core processing of incoming raw data and updates real-time SCADA objects. A 64-bit quality assessment of all data is made and published to services including alarms, events, HMI, application interfaces, and history. Supervisory controls are securely managed using “check before execute” sequence management. Some of the features provided by the alarm system are: High and low limits,Severity zones on analog alarms,Alarm priority,Alarm filtering,Audible annunciation Audible acknowledgement,Alarm list line and page-based acknowledgment,Better and worse analog alarm tracking. Database The Database subsystem manages all objects instantiated in memory and on disk in the system for read, write, install, redundancy, and data persistence. The database used to achieve this is the commercially available Versant® Object Oriented Database Management System (OODBMS).Examples of system objects include:Host stations, Scanned devices (for example, RTUs),Communication channels,Point data, Scan rates,Points. Point data can be associated with multiple operational regions, a particular alarm group and category. These associations are used later for list filtering and permission for control access. History The history subsystem provides distributed redundant storage of SCADA data samples for up to one year on-line.All change-based data samples are recorded for later retrieval. Data samples arriving late or out of sequence due to communications failures are retrospectively merged with the stored data sequence for each point.Older data can be automatically compressed to optimize storage space. Disturbance triggers can be assigned to prevent subsequent compression of data associated with a plant disturbance.The history subsystem also manages the transfer and retrieval of data to optical archive. The history system supports the trend display, tabular list display, and structured query language (SQL) queries. User specified transformations on historical data such as Max/Min/Avg can be Application Programming Interface:The application programming interface provides an Object Interface Library (OIL) for integrating OEM process applications, user-developed application packages and real-time data interfaces using C/C++ programming language. Structured query language enables open database connectivity (ODBC) to enterprise databases for corporate data exchange and personal computer desktop applications access. Supervisory A SCADA process monitor runs in each UNIX workstation to supervise and report on the state of the SCADA subsystems running in each machine. Network Time Protocol (NTP) is used to synchronize time between the NTP time master and all other LAN connected UNIX servers.Windows based workstations are synchronized using Microsoft NTP or equivalent resources for Windows PCs and Servers. ''' answer = pipe(question=input_text, context=context) return answer iface = gr.Interface(fn = get_answer, inputs = "text", outputs = ['text'], title = 'question-answering', description="question-answering for the given input") iface.launch(inline = False)