mgetz commited on
Commit
fb15c2c
·
verified ·
1 Parent(s): 49d9c6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -1,10 +1,20 @@
1
  from huggingface_hub import InferenceClient
 
 
 
2
 
3
  import gradio as gr
4
  import random
5
 
6
  client=InferenceClient("HuggingFaceH4/zephyr-7b-beta")
 
 
 
 
 
7
 
 
 
8
  def respond(message, history):
9
  messages = [
10
  {"role":"system",
 
1
  from huggingface_hub import InferenceClient
2
+ #STEP 1 from Semantic Search (import libraries)
3
+ from sentence_transformers import SentenceTransformer
4
+ import torch
5
 
6
  import gradio as gr
7
  import random
8
 
9
  client=InferenceClient("HuggingFaceH4/zephyr-7b-beta")
10
+ #STEP 2 from semantic search (read file)
11
+ # Open the water_cycle.txt file in read mode with UTF-8 encoding
12
+ with open("water_cycle.txt", "r", encoding="utf-8") as file:
13
+ # Read the entire contents of the file and store it in a variable
14
+ water_cycle_text = file.read()
15
 
16
+ # Print the text below
17
+ print(water_cycle_text)
18
  def respond(message, history):
19
  messages = [
20
  {"role":"system",