Pclanglais commited on
Commit
4777829
·
verified ·
1 Parent(s): 6060f97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -15
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import transformers
2
  import re
3
  from transformers import AutoConfig, AutoTokenizer, AutoModel, AutoModelForCausalLM
4
- from vllm import LLM, SamplingParams
5
  import torch
6
  import gradio as gr
7
  import json
@@ -70,20 +69,6 @@ def split_text(text, max_tokens=500):
70
  return chunks
71
 
72
 
73
- #Curtesy of claude
74
- def generate_html_diff(old_text, new_text):
75
- d = difflib.Differ()
76
- diff = list(d.compare(old_text.split(), new_text.split()))
77
-
78
- html_diff = []
79
- for word in diff:
80
- if word.startswith(' '):
81
- html_diff.append(word[2:])
82
- elif word.startswith('+ '):
83
- html_diff.append(f'<span style="background-color: #90EE90;">{word[2:]}</span>')
84
- # We're not adding anything for words that start with '- '
85
-
86
- return ' '.join(html_diff)
87
 
88
  # Class to encapsulate the Falcon chatbot
89
  class MistralChatBot:
 
1
  import transformers
2
  import re
3
  from transformers import AutoConfig, AutoTokenizer, AutoModel, AutoModelForCausalLM
 
4
  import torch
5
  import gradio as gr
6
  import json
 
69
  return chunks
70
 
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  # Class to encapsulate the Falcon chatbot
74
  class MistralChatBot: