HFHAB commited on
Commit
c1afe66
·
verified ·
1 Parent(s): 738fcc6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -3
main.py CHANGED
@@ -6,7 +6,7 @@ import uvicorn
6
 
7
  app = FastAPI()
8
 
9
- client = InferenceClient("bertilmuth/phi")
10
 
11
  class Item(BaseModel):
12
  prompt: str
@@ -41,8 +41,11 @@ def generate(item: Item):
41
  seed=42,
42
  )
43
 
44
- formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}", item.history)
45
- stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
 
 
 
46
  output = ""
47
 
48
  for response in stream:
 
6
 
7
  app = FastAPI()
8
 
9
+ client = InferenceClient("FacebookAI/roberta-large-mnli")
10
 
11
  class Item(BaseModel):
12
  prompt: str
 
41
  seed=42,
42
  )
43
 
44
+ #formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}", item.history)
45
+ text = item.prompt
46
+ labels = ["Requirement", "Information"]
47
+ client.zero_shot_classification(text, labels)
48
+ #stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
49
  output = ""
50
 
51
  for response in stream: